home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / prog / atari / c / ck5a189s / ckuxla.c < prev    next >
C/C++ Source or Header  |  1993-06-04  |  171KB  |  4,420 lines

  1. #ifndef NOCSETS
  2. char *xlav = "Character Set Translation 5A(020), 2 May 93";
  3.  
  4. /*  C K U X L A  */
  5.  
  6. /*  C-Kermit tables and functions supporting character set translation.  */
  7. /*
  8.   Author: Frank da Cruz (fdc@columbia.edu, FDCCU@CUVMA.BITNET),
  9.   Columbia University Academic Information Systems, New York City.
  10.  
  11.   Copyright (C) 1985, 1993, Trustees of Columbia University in the City of New
  12.   York.  The C-Kermit software may not be, in whole or in part, licensed or
  13.   sold for profit as a software product itself, nor may it be included in or
  14.   distributed with commercial products or otherwise distributed by commercial
  15.   concerns to their clients or customers without written permission of the
  16.   Office of Kermit Development and Distribution, Columbia University.  This
  17.   copyright notice must not be removed, altered, or obscured.
  18. */
  19.  
  20. /*
  21.   CAVEAT PROGRAMMATOR: The mechanism used herein turns out to be somewhat
  22.   inflexible and maybe a little dangerous.  It is designed for Kermit's
  23.   character-at-a-time processing during protocol operations.  Elaborate
  24.   kludges are used for translating one character into two (like stuffing an
  25.   extra character into the input stream), or two into one, or two into two.
  26.  
  27.   The whole translation business needs to be redesigned to be string-oriented
  28.   rather than character oriented, so (a) we can have more flexible
  29.   translations, and (b) we don't have to be concerned about which input stream
  30.   we are using.  The current mechanism is also quite inappropriate
  31.   for multibyte character sets and for flexible user-defined translations.
  32.  
  33.   For the future: perhaps it would be better to represent characters
  34.   internally using a universal character set like UNICODE (ISO 10646 BMP),
  35.   the ultimate "transfer character set".
  36. */
  37. #include "ckcdeb.h"            /* Includes... */
  38. #include "ckcker.h"
  39. #include "ckucmd.h"
  40. #include "ckcxla.h"
  41.  
  42. /* Character set translation data and functions */
  43.  
  44. extern int zincnt;            /* File i/o macros and variables */
  45. extern char *zinptr;
  46. extern int zoutcnt;
  47. extern char *zoutptr;
  48.  
  49. int tslevel  = TS_L0;            /* Transfer syntax level (0,1,2) */
  50. int tcharset = TC_TRANSP;        /* Transfer syntax character set */
  51. int tcsr     = FC_USASCII;        /* Remote terminal character set */
  52. int language = L_USASCII;        /* Language */
  53.  
  54. /*
  55.   Default local file and terminal character set.
  56.   Normally ASCII, but for some systems we know otherwise.
  57. */
  58. #ifdef datageneral            /* Data General AOS/VS */
  59. int fcharset = FC_DGMCS;        /* uses the DG International set */
  60. int tcsl     = FC_DGMCS;
  61. #else
  62. #ifdef NEXT                /* The NeXT workstation */
  63. int fcharset = FC_NEXT;            /* uses its own 8-bit set */
  64. int tcsl     = FC_NEXT;
  65. #else
  66. #ifdef MAC                /* The Macintosh */
  67. int fcharset = FC_APPQD;        /* uses an extended version of */
  68. int tcsl     = FC_APPQD;        /* Apple Quickdraw */
  69. #else
  70. #ifdef AUX
  71. int fcharset = FC_APPQD;        /* Ditto for Apple A/UX */
  72. int tcsl     = FC_APPQD;
  73. #else
  74. #ifdef AMIGA                /* The Commodore Amiga */
  75. int fcharset = FC_1LATIN;        /* uses Latin-1 */
  76. int tcsl     = FC_1LATIN;
  77. #else                    /* All others */
  78. int fcharset = FC_USASCII;        /* use ASCII by default */
  79. int tcsl     = FC_USASCII;
  80. #endif /* AMIGA */
  81. #endif /* AUX */
  82. #endif /* MAC */
  83. #endif /* NEXT */
  84. #endif /* datageneral */
  85.  
  86. /* Bureaucracy section */
  87.  
  88. _PROTOTYP( CHAR xnel1, (CHAR c) );    /* NeXT to Latin-1 */
  89. _PROTOTYP( CHAR xl143, (CHAR c) );    /* Latin-1 to IBM CP437 */
  90. _PROTOTYP( CHAR xl1as, (CHAR c) );    /* Latin-1 to US ASCII */
  91. _PROTOTYP( CHAR zl1as, (CHAR c) );    /* Latin-1 to US ASCII */
  92.  
  93. #ifdef CYRILLIC
  94. _PROTOTYP( CHAR xassk, (CHAR c) );    /* ASCII to Short KOI */
  95. _PROTOTYP( CHAR xskcy, (CHAR c) );    /* Short KOI to Latin/Cyrillic */
  96. #endif /* CYRILLIC */
  97.  
  98. #ifdef LATIN2
  99. _PROTOTYP( CHAR xnel2, (CHAR c) );    /* NeXT to Latin-2 */
  100. _PROTOTYP( CHAR xl243, (CHAR c) );    /* Latin-2 to IBM CP437 */
  101. _PROTOTYP( CHAR xl2as, (CHAR c) );    /* Latin-2 to US ASCII */
  102. _PROTOTYP( CHAR zl2as, (CHAR c) );    /* Latin-2 to US ASCII */
  103. #endif /* LATIN2 */
  104.  
  105. /* Transfer character-set info */
  106.  
  107. struct csinfo tcsinfo[] = {
  108. /*  Name              size code      designator alphabet keyword            */
  109.   "TRANSPARENT",       256,TC_TRANSP, "",      AL_UNK,  "transparent", /* 0 */
  110.   "ASCII",             128,TC_USASCII,"",      AL_ROMAN,"ascii",       /* 1 */
  111.   "LATIN1, ISO 8859-1",256,TC_1LATIN, "I6/100",AL_ROMAN,"latin1-iso",  /* 2 */
  112. #ifdef LATIN2
  113.   "LATIN2, ISO 8859-2",256,TC_2LATIN, "I6/101",AL_ROMAN,"latin2-iso",  /* 3 */
  114. #endif /* LATIN2 */
  115. #ifdef CYRILLIC
  116.   "CYRILLIC, ISO 8859-5",256,TC_CYRILL,"I6/144",AL_CYRIL,"cyrillic-iso",/* 4 */
  117. #endif /* CYRILLIC */
  118. #ifdef KANJI
  119.   "KANJI (EUC)", 16384,TC_JEUC,  "I14/87/13", AL_JAPAN, "japanese-euc", /* 5 */
  120. #endif /* KANJI */
  121. #ifdef HEBREW
  122.   "HEBREW, ISO 8859-8",256,TC_HEBREW,"I6/138",AL_HEBREW,"hebrew-iso"    /* 6 */
  123. #endif /* HEBREW */
  124. };
  125. int ntcsets = (sizeof(tcsinfo) / sizeof(struct csinfo));
  126.  
  127. struct keytab tcstab[] = {        /* Keyword table for */
  128.     "ascii",         TC_USASCII, 0,    /* SET TRANSFER CHARACTER-SET */
  129. #ifdef CYRILLIC
  130.     "cyrillic-iso",  TC_CYRILL,  0,
  131. #endif /* CYRILLIC */
  132. #ifdef HEBREW
  133.     "hebrew-iso",    TC_HEBREW,  0,
  134. #endif /* HEBREW */
  135. #ifdef KANJI
  136.     "japanese-euc",  TC_JEUC,    0,
  137. #endif /* KANJI */
  138. #ifdef LATIN2
  139. /*
  140.   If Latin-2 is defined, let the following be invisible, non-unique
  141.   abbreviations for LATIN1.
  142. */
  143.     "l",             TC_1LATIN,  CM_ABR|CM_INV,
  144.     "la",            TC_1LATIN,  CM_ABR|CM_INV,
  145.     "lat",           TC_1LATIN,  CM_ABR|CM_INV,
  146.     "lati",          TC_1LATIN,  CM_ABR|CM_INV,
  147.     "latin",         TC_1LATIN,  CM_ABR|CM_INV,
  148. #endif /* LATIN2 */
  149.     "latin1-iso",    TC_1LATIN,  0,
  150. #ifdef LATIN2
  151.     "latin2-iso",    TC_2LATIN,  0,
  152. #endif /* LATIN2 */
  153.     "transparent",   TC_TRANSP,  0
  154. };
  155. int ntcs = (sizeof(tcstab) / sizeof(struct keytab));
  156.  
  157. /* File character set information structure, indexed by character set code, */
  158. /* as defined in ckuxla.h.  This table must be in order of file character */
  159. /* set number! */ 
  160.  
  161. struct csinfo fcsinfo[] = { /* File character set information... */
  162.   /* Descriptive Name              Size  Designator */
  163.   "US ASCII",                     128, FC_USASCII, NULL, AL_ROMAN, "ascii",
  164.   "British/UK ISO-646",           128, FC_UKASCII, NULL, AL_ROMAN, "british",
  165.   "Dutch ISO-646",                128, FC_DUASCII, NULL, AL_ROMAN, "dutch",
  166.   "Finnish ISO-646",              128, FC_FIASCII, NULL, AL_ROMAN, "finnish",
  167.   "French ISO-646",               128, FC_FRASCII, NULL, AL_ROMAN, "french",
  168.   "Canadian-French NRC", 128, FC_FCASCII, NULL, AL_ROMAN, "canadian-french",
  169.   "German ISO-646",               128, FC_GEASCII, NULL, AL_ROMAN, "german",
  170.   "Hungarian ISO-646",            128, FC_HUASCII, NULL, AL_ROMAN, "hungarian",
  171.   "Italian ISO-646",              128, FC_ITASCII, NULL, AL_ROMAN, "italian",
  172.   "Norwegian/Danish ISO-646",128,FC_NOASCII,NULL,AL_ROMAN,"norwegian/danish",
  173.   "Portuguese ISO-646",           128, FC_POASCII, NULL, AL_ROMAN,"portuguese",
  174.   "Spanish ISO-646",              128, FC_SPASCII, NULL, AL_ROMAN, "spanish",
  175.   "Swedish ISO-646",              128, FC_SWASCII, NULL, AL_ROMAN, "swedish",
  176.   "Swiss NRC",                    128, FC_CHASCII, NULL, AL_ROMAN, "swiss",
  177.   "ISO 8859-1 Latin-1",           256, FC_1LATIN,  NULL, AL_ROMAN,"latin1-iso",
  178. #ifdef LATIN2
  179.   "ISO 8859-2 Latin-2",           256, FC_2LATIN,  NULL, AL_ROMAN,"latin2-iso",
  180. #endif /* LATIN2 */
  181.   "DEC Multinational", 256,  FC_DECMCS, NULL,AL_ROMAN,"dec-multinational",
  182.   "NeXT Multinational", 256, FC_NEXT,   NULL,AL_ROMAN,"next-multinational",
  183.   "IBM Code Page 437",            256, FC_CP437,   NULL, AL_ROMAN,"cp437",
  184.   "IBM Code Page 850",            256, FC_CP850,   NULL, AL_ROMAN,"cp850",
  185. #ifdef LATIN2
  186.   "IBM Code Page 852",            256, FC_CP852,   NULL, AL_ROMAN,"cp852",
  187. #endif /* LATIN2 */
  188.   "Apple Macintosh Latin", 256, FC_APPQD,   NULL, AL_ROMAN,"macintosh-latin",
  189.   "Data General International",256,FC_DGMCS,NULL,AL_ROMAN,"dg-international"
  190. #ifdef CYRILLIC
  191. , "ISO 8859-5 Latin/Cyrillic", 256, FC_CYRILL,  NULL, AL_CYRIL,"cyrillic-iso",
  192.   "CP866 Cyrillic",           256, FC_CP866,   NULL, AL_CYRIL,"cp866",
  193.   "Short KOI",                 128, FC_KOI7,    NULL, AL_CYRIL,"short-koi",
  194.   "Old KOI-8 Cyrillic",        256, FC_KOI8,    NULL, AL_CYRIL,"koi8-cyrillic"
  195. #endif /* CYRILLIC */
  196. #ifdef KANJI
  197. , "Japanese JIS7",        256, FC_JIS7,    NULL, AL_JAPAN, "jis7-kanji",
  198.   "Japanese Shift JIS",      16384, FC_SHJIS,   NULL, AL_JAPAN, "shift-jis-kanji",
  199.   "Japanese EUC",      16384, FC_JEUC,    NULL, AL_JAPAN, "japanese-euc",
  200.   "Japanese DEC Kanji",      16384, FC_JDEC,    NULL, AL_JAPAN, "dec-kanji"
  201. #endif /* KANJI */
  202. #ifdef HEBREW
  203. , "Hebrew-7 DEC",           128, FC_HE7,     NULL, AL_HEBREW, "hebrew-7",
  204.   "ISO 8859-8 Latin/Hebrew",256, FC_HEBREW,  NULL, AL_HEBREW, "hebrew-iso",
  205.   "CP862 Hebrew",           256, FC_CP862,   NULL, AL_HEBREW, "cp862-hebrew"
  206. #endif /* HEBREW */
  207. };    
  208.  
  209. /* Local file character sets */
  210. /* Includes 7-bit National Replacement Character Sets of ISO 646 */
  211. /* Plus ISO Latin-1, DEC Multinational Character Set (MCS), NeXT char set */
  212.  
  213. struct keytab fcstab[] = { /* Keyword table for 'set file character-set' */
  214.  
  215. /*
  216.   IMPORTANT: This table is replicated below as ttcstab (terminal character 
  217.   set table).  The only differences are the addition of TRANSPARENT
  218.   and the removal of the Kanji sets, which are not supported yet.
  219.   If you make changes to this table, also change ttcstab.
  220. */
  221.  
  222. /* Keyword             Value       Flags */
  223.     "apple-quickdraw",    FC_APPQD,   CM_INV, /* Apple Quickdraw */
  224.     "ascii",              FC_USASCII, 0, /* ASCII */
  225.     "british",            FC_UKASCII, 0, /* British NRC */
  226.     "canadian-french",    FC_FCASCII, 0, /* French Canadian NRC */
  227.     "cp437",              FC_CP437,   0, /* PC CP437 */
  228.     "cp850",              FC_CP850,   0, /* PC CP850 */
  229. #ifdef LATIN2
  230.     "cp852",              FC_CP852,   0, /* PC CP852 */
  231. #endif /* LATIN2 */
  232. #ifdef HEBREW
  233.     "cp862-hebrew",       FC_CP862,   0, /* PC CP862 */
  234. #endif /* HEBREW */
  235. #ifdef CYRILLIC
  236.     "cp866-cyrillic",     FC_CP866,   0, /* CP866 Cyrillic */
  237.     "cyrillic-iso",       FC_CYRILL,  0, /* ISO Latin/Cyrillic Alphabet */
  238. #endif /* CYRILLIC */
  239.     "danish",             FC_NOASCII, 0, /* Norwegian and Danish NRC */
  240. #ifdef KANJI
  241.     "dec-kanji",          FC_JDEC,    0, /* Japanese DEC Kanji */
  242. #endif /* KANJI */
  243.     "dec-multinational",  FC_DECMCS,  0, /* DEC multinational character set */
  244.     "dg-international",   FC_DGMCS,   0, /* Data General multinational */
  245.     "dutch",              FC_DUASCII, 0, /* Dutch NRC */
  246.     "finnish",            FC_FIASCII, 0, /* Finnish NRC */
  247.     "french",             FC_FRASCII, 0, /* French NRC */
  248.     "fr-canadian",        FC_FCASCII, CM_INV, /* French Canadian NRC */
  249.     "german",             FC_GEASCII, 0, /* German NRC */
  250. #ifdef HEBREW
  251.     "he",                 FC_HEBREW,  CM_ABR|CM_INV,
  252.     "heb",                FC_HEBREW,  CM_ABR|CM_INV,
  253.     "hebr",               FC_HEBREW,  CM_ABR|CM_INV,
  254.     "hebre",              FC_HEBREW,  CM_ABR|CM_INV,
  255.     "hebrew",             FC_HEBREW,  CM_ABR|CM_INV,
  256.     "hebrew-7",           FC_HE7,     0, /* DEC 7-Bit Hebrew */
  257.     "hebrew-iso",         FC_HEBREW,  0, /* ISO Latin/Hebrew */
  258. #endif /* HEBREW */
  259.     "hungarian",          FC_HUASCII, 0, /* Hungarian NRC */
  260.     "italian",            FC_ITASCII, 0, /* Italian NRC */
  261. #ifdef KANJI
  262.     "japanese-euc",       FC_JEUC,    0, /* Japanese EUC */
  263.     "jis7-kanji",         FC_JIS7,    0, /* Japanese JIS7 7bit code */
  264. #endif /* KANJI */
  265. #ifdef CYRILLIC
  266.     "koi8-cyrillic",      FC_KOI8,    0, /* Old KOI-8 Cyrillic */
  267. #endif /* CYRILLIC */
  268. #ifdef LATIN2
  269.     "l",                  FC_1LATIN,  CM_ABR|CM_INV,
  270.     "la",                 FC_1LATIN,  CM_ABR|CM_INV,
  271.     "lat",                FC_1LATIN,  CM_ABR|CM_INV,
  272.     "lati",               FC_1LATIN,  CM_ABR|CM_INV,
  273.     "latin",              FC_1LATIN,  CM_ABR|CM_INV,
  274. #endif /* LATIN2 */
  275.     "latin1-iso",         FC_1LATIN,  0, /* ISO Latin Alphabet 1 */
  276. #ifdef LATIN2
  277.     "latin2-iso",         FC_2LATIN,  0, /* ISO Latin Alphabet 2 */
  278. #endif /* LATIN2 */
  279.     "macintosh-latin",    FC_APPQD,   0, /* "Extended Mac Latin" */
  280.     "next-multinational", FC_NEXT,    0, /* NeXT workstation */
  281.     "norwegian",          FC_NOASCII, 0, /* Norwegian and Danish NRC */
  282.     "portuguese",         FC_POASCII, 0, /* Portuguese NRC */
  283. #ifdef KANJI
  284.     "shift-jis-kanji",    FC_SHJIS,   0, /* Japanese Kanji Shift-JIS */
  285. #endif /* KANJI */
  286. #ifdef CYRILLIC
  287.     "short-koi",          FC_KOI7,    0, /* Short KOI Cyrillic */
  288. #endif /* CYRILLIC */
  289.     "spanish",            FC_SPASCII, 0, /* Spanish NRC */
  290.     "swedish",            FC_SWASCII, 0, /* Swedish NRC */
  291.     "swiss",              FC_CHASCII, 0     /* Swiss NRC */
  292. };
  293. int nfilc = (sizeof(fcstab) / sizeof(struct keytab)); /* size of this table */
  294.  
  295.  
  296. struct keytab ttcstab[] = { /* Keyword table for SET TERMINAL CHARACTER-SET */
  297. /*
  298.   IMPORTANT: This table is a replica of fcstab, immediately above, with the
  299.   addition of TRANSPARENT.  If you make changes to this table, make the
  300.   corresponding changes to fcstab.
  301. */
  302. /* Keyword               Value       Flags */
  303.     "apple-quickdraw",    FC_APPQD,   CM_INV, /* Apple Quickdraw */
  304.     "ascii",              FC_USASCII, 0, /* ASCII */
  305.     "british",            FC_UKASCII, 0, /* British NRC */
  306.     "canadian-french",    FC_FCASCII, 0, /* French Canadian NRC */
  307.     "cp437",              FC_CP437,   0, /* IBM CP437 */
  308.     "cp850",              FC_CP850,   0, /* IBM CP850 */
  309. #ifdef LATIN2
  310.     "cp852",              FC_CP852,   0, /* IBM CP852 */
  311. #endif /* LATIN2 */
  312. #ifdef HEBREW
  313.     "cp862-hebrew",       FC_CP862,   0, /* PC CP862 */
  314. #endif /* HEBREW */
  315. #ifdef CYRILLIC
  316.     "cp866-cyrillic",     FC_CP866,   0, /* CP866 Cyrillic */
  317.     "cyrillic-iso",       FC_CYRILL,  0, /* ISO Latin/Cyrillic Alphabet */
  318. #endif /* CYRILLIC */
  319.     "danish",             FC_NOASCII, 0, /* Norwegian and Danish NRC */
  320. #ifdef COMMENT
  321. #ifdef KANJI
  322.     "dec-kanji",          FC_JDEC,    0, /* Japanese DEC Kanji */
  323. #endif /* KANJI */
  324. #endif /* COMMENT */
  325.     "dec-multinational",  FC_DECMCS,  0, /* DEC multinational character set */
  326.     "dg-international",   FC_DGMCS,   0, /* Data General multinational */
  327.     "dutch",              FC_DUASCII, 0, /* Dutch NRC */
  328.     "finnish",            FC_FIASCII, 0, /* Finnish NRC */
  329.     "french",             FC_FRASCII, 0, /* French NRC */
  330.     "fr-canadian",        FC_FCASCII, CM_INV, /* French Canadian NRC */
  331.     "german",             FC_GEASCII, 0, /* German NRC */
  332. #ifdef HEBREW
  333.     "he",                 FC_HEBREW,  CM_ABR|CM_INV,
  334.     "heb",                FC_HEBREW,  CM_ABR|CM_INV,
  335.     "hebr",               FC_HEBREW,  CM_ABR|CM_INV,
  336.     "hebre",              FC_HEBREW,  CM_ABR|CM_INV,
  337.     "hebrew",             FC_HEBREW,  CM_ABR|CM_INV,
  338.     "hebrew-7",           FC_HE7,     0, /* DEC 7-Bit Hebrew */
  339.     "hebrew-iso",         FC_HEBREW,  0, /* ISO Latin/Hebrew */
  340. #endif /* HEBREW */
  341.     "hungarian",          FC_HUASCII, 0, /* Hungarian NRC */
  342.     "italian",            FC_ITASCII, 0, /* Italian NRC */
  343. #ifdef COMMENT
  344. /* Kanji terminal character sets not implemented yet */
  345. #ifdef KANJI
  346.     "japanese-euc",       FC_JEUC,    0, /* Japanese EUC */
  347.     "jis7-kanji",         FC_JIS7,    0, /* Japanese JIS7 7bit code */
  348. #endif /* KANJI */
  349. #endif /* COMMENT */
  350. #ifdef CYRILLIC
  351.     "koi8-cyrillic",      FC_KOI8,    0, /* Old KOI-8 Cyrillic */
  352. #endif /* CYRILLIC */
  353. #ifdef LATIN2
  354.     "l",                  FC_1LATIN,  CM_ABR|CM_INV,
  355.     "la",                 FC_1LATIN,  CM_ABR|CM_INV,
  356.     "lat",                FC_1LATIN,  CM_ABR|CM_INV,
  357.     "lati",               FC_1LATIN,  CM_ABR|CM_INV,
  358.     "latin",              FC_1LATIN,  CM_ABR|CM_INV,
  359. #endif /* LATIN2 */
  360.     "latin1-iso",         FC_1LATIN,  0, /* ISO Latin Alphabet 1 */
  361. #ifdef LATIN2
  362.     "latin2-iso",         FC_2LATIN,  0, /* ISO Latin Alphabet 2 */
  363. #endif /* LATIN2 */
  364.     "macintosh-latin",    FC_APPQD,   0, /* "Extended Mac Latin */
  365.     "next-multinational", FC_NEXT,    0, /* NeXT workstation */
  366.     "norwegian",          FC_NOASCII, 0, /* Norwegian and Danish NRC */
  367.     "portuguese",         FC_POASCII, 0, /* Portuguese NRC */
  368. #ifdef COMMENT
  369. /* Kanji terminal character sets not implemented yet. */
  370. #ifdef KANJI
  371.     "shift-jis-kanji",    FC_SHJIS,   0, /* Japanese Kanji Shift-JIS */
  372. #endif /* KANJI */
  373. #endif /* COMMENT */
  374. #ifdef CYRILLIC
  375.     "short-koi",          FC_KOI7,    0, /* Short KOI Cyrillic */
  376. #endif /* CYRILLIC */
  377.     "spanish",            FC_SPASCII, 0, /* Spanish NRC */
  378.     "swedish",            FC_SWASCII, 0, /* Swedish NRC */
  379.     "swiss",              FC_CHASCII, 0, /* Swiss NRC */
  380.     "transparent",        FC_TRANSP,  0  /* Transparent */
  381. };
  382. int ntermc = (sizeof(ttcstab) / sizeof(struct keytab)); /* size of table */
  383.  
  384. /*
  385.  Languages:
  386.  
  387.  This table allows C-Kermit to have a SET LANGUAGE command to apply special
  388.  language-specific rules when translating from a character set that contains
  389.  national characters into plain ASCII, like German umlaut-a becomes ae.
  390.  
  391.  Originally, I thought it would be a good idea to let SET LANGUAGE also select
  392.  an appropriate FILE CHARACTER-SET and TRANSFER CHARACTER-SET automatically,
  393.  and these are included in the langinfo structure.  Later I realized that this
  394.  was a bad idea.  Users are confused by unexpected side effects.  If this
  395.  functionality is desired, it's better to define a macro to do it.
  396. */
  397.  
  398. struct langinfo langs[] = {
  399. /*  Language code   File Charset Xfer Charset Name */
  400.     L_USASCII,      FC_USASCII,  TC_USASCII,  "ASCII (American English)",
  401.     L_DANISH,       FC_NOASCII,  TC_1LATIN,   "Danish",
  402.     L_DUTCH,        FC_DUASCII,  TC_1LATIN,   "Dutch",
  403.     L_FINNISH,      FC_FIASCII,  TC_1LATIN,   "Finnish",
  404.     L_FRENCH,       FC_FRASCII,  TC_1LATIN,   "French",
  405.     L_GERMAN,       FC_GEASCII,  TC_1LATIN,   "German",
  406. #ifdef HEBREW
  407.     L_HEBREW,       FC_HEBREW,   TC_HEBREW,   "Hebrew",
  408. #endif /* HEBREW */
  409.     L_HUNGARIAN,    FC_HUASCII,  TC_2LATIN,   "Hungarian",
  410.     L_ICELANDIC,    FC_USASCII,  TC_1LATIN,   "Icelandic",
  411.     L_ITALIAN,      FC_ITASCII,  TC_1LATIN,   "Italian",
  412. #ifdef KANJI
  413.     L_JAPANESE,     FC_JEUC,     TC_JEUC,     "Japanese",
  414. #endif /* KANJI */
  415.     L_NORWEGIAN,    FC_NOASCII,  TC_1LATIN,   "Norwegian",
  416.     L_PORTUGUESE,   FC_POASCII,  TC_1LATIN,   "Portuguese",
  417. #ifdef CYRILLIC
  418.     L_RUSSIAN,      FC_CP866,    TC_CYRILL,   "Russian",
  419. #endif /* CYRILLIC */
  420.     L_SPANISH,      FC_SPASCII,  TC_1LATIN,   "Spanish",
  421.     L_SWEDISH,      FC_SWASCII,  TC_1LATIN,   "Swedish",
  422.     L_SWISS,        FC_CHASCII,  TC_1LATIN,   "Swiss"
  423. };
  424. int nlangs = (sizeof(langs) / sizeof(struct langinfo));
  425.  
  426. /*
  427.   Keyword table for the SET LANGUAGE command.
  428.   Only a few of these (German, Scandinavian, etc) actually do anything.
  429.   The language is used to invoke special translation rules when converting
  430.   from an 8-bit character set to ASCII; for example, German u-diaeresis
  431.   becomes "ue", Dutch y-diaeresis becomes "ij".  Languages without associated
  432.   rules are invisible (CM_INV).
  433. */
  434. struct keytab lngtab[] = {
  435.     "ascii",            L_USASCII,    CM_INV,
  436.     "danish",           L_DANISH,     0,
  437.     "dutch",            L_DUTCH,      0,
  438.     "english",          L_USASCII,    CM_INV,
  439.     "finnish",          L_FINNISH,    0,
  440.     "french",           L_FRENCH,     0,
  441.     "german",           L_GERMAN,     0,
  442. #ifdef HEBREW
  443.     "hebrew",           L_HEBREW,     CM_INV,
  444. #endif /* HEBREW */    
  445.     "hungarian",        L_HUNGARIAN,  CM_INV,
  446.     "icelandic",        L_ICELANDIC,  0,
  447.     "italian",          L_ITALIAN,    CM_INV,
  448. #ifdef KANJI
  449.     "japanese",         L_JAPANESE,   CM_INV,
  450. #endif /* KANJI */
  451.     "norwegian",        L_NORWEGIAN,  0,
  452.     "none",             L_USASCII,    0,
  453.     "portuguese",       L_PORTUGUESE, CM_INV,
  454. #ifdef CYRILLIC
  455.     "russian",          L_RUSSIAN,    0,
  456. #endif /* CYRILLIC */
  457.     "spanish",          L_SPANISH,    CM_INV,
  458.     "swedish",          L_SWEDISH,    0
  459. #ifdef CYRILLIC
  460. ,   "ukrainian",        L_RUSSIAN,    0
  461. #endif /* CYRILLIC */
  462. };
  463. int nlng = (sizeof(lngtab) / sizeof(struct keytab)); /* how many languages */
  464.  
  465.  
  466. /* Translation tables ... */
  467.  
  468. /*
  469.   For each pair of (transfer,file) character sets, we need two translation
  470.   functions, one for sending, one for receiving.
  471. */
  472.  
  473. /*
  474.   Here is the first table, Latin-1 to ASCII, fully annotated...
  475.   This one is absolutely NOT invertible, since we're going from an 8-bit
  476.   set to a 7-bit set.  Accented letters are mapped to unaccented
  477.   equivalents, C1 control characters are all translated to "?", etc.
  478. */
  479. CHAR
  480. yl1as[] = {  /* ISO 8859-1 Latin Alphabet 1 to US ASCII */
  481.       /*  Source character    Description               => Translation */
  482.       /*  Dec row/col Set                                           */
  483.   0,  /*  000  00/00  C0 NUL  Ctrl-@                    =>  (self)  */
  484.   1,  /*  001  00/01  C0 SOH  Ctrl-A                    =>  (self)  */
  485.   2,  /*  002  00/02  C0 STX  Ctrl-B                    =>  (self)  */
  486.   3,  /*  003  00/03  C0 ETX  Ctrl-C                    =>  (self)  */
  487.   4,  /*  004  00/04  C0 EOT  Ctrl-D                    =>  (self)  */
  488.   5,  /*  005  00/05  C0 ENQ  Ctrl-E                    =>  (self)  */
  489.   6,  /*  006  00/06  C0 ACK  Ctrl-F                    =>  (self)  */
  490.   7,  /*  007  00/07  C0 BEL  Ctrl-G                    =>  (self)  */
  491.   8,  /*  008  00/08  C0 BS   Ctrl-H                    =>  (self)  */
  492.   9,  /*  009  00/09  C0 HT   Ctrl-I                    =>  (self)  */
  493.  10,  /*  010  00/10  C0 LF   Ctrl-J                    =>  (self)  */
  494.  11,  /*  011  00/11  C0 VT   Ctrl-K                    =>  (self)  */
  495.  12,  /*  012  00/12  C0 FF   Ctrl-L                    =>  (self)  */
  496.  13,  /*  013  00/13  C0 CR   Ctrl-M                    =>  (self)  */
  497.  14,  /*  014  00/14  C0 SO   Ctrl-N                    =>  (self)  */
  498.  15,  /*  015  00/15  C0 SI   Ctrl-O                    =>  (self)  */
  499.  16,  /*  016  01/00  C0 DLE  Ctrl-P                    =>  (self)  */
  500.  17,  /*  017  01/01  C0 DC1  Ctrl-Q                    =>  (self)  */
  501.  18,  /*  018  01/02  C0 DC2  Ctrl-R                    =>  (self)  */
  502.  19,  /*  019  01/03  C0 DC3  Ctrl-S                    =>  (self)  */
  503.  20,  /*  020  01/04  C0 DC4  Ctrl-T                    =>  (self)  */
  504.  21,  /*  021  01/05  C0 NAK  Ctrl-U                    =>  (self)  */
  505.  22,  /*  022  01/06  C0 SYN  Ctrl-V                    =>  (self)  */
  506.  23,  /*  023  01/07  C0 ETB  Ctrl-W                    =>  (self)  */
  507.  24,  /*  024  01/08  C0 CAN  Ctrl-X                    =>  (self)  */
  508.  25,  /*  025  01/09  C0 EM   Ctrl-Y                    =>  (self)  */
  509.  26,  /*  026  01/10  C0 SUB  Ctrl-Z                    =>  (self)  */
  510.  27,  /*  027  01/11  C0 ESC  Ctrl-[                    =>  (self)  */
  511.  28,  /*  028  01/12  C0 FS   Ctrl-\                    =>  (self)  */
  512.  29,  /*  029  01/13  C0 GS   Ctrl-]                    =>  (self)  */
  513.  30,  /*  030  01/14  C0 RS   Ctrl-^                    =>  (self)  */
  514.  31,  /*  031  01/15  C0 US   Ctrl-_                    =>  (self)  */
  515.  32,  /*  032  02/00     SP   Space                     =>  (self)  */
  516.  33,  /*  033  02/01  G0 !    Exclamation mark          =>  (self)  */
  517.  34,  /*  034  02/02  G0 "    Doublequote               =>  (self)  */
  518.  35,  /*  035  02/03  G0 #    Number sign               =>  (self)  */
  519.  36,  /*  036  02/04  G0 $    Dollar sign               =>  (self)  */
  520.  37,  /*  037  02/05  G0 %    Percent sign              =>  (self)  */
  521.  38,  /*  038  02/06  G0 &    Ampersand                 =>  (self)  */
  522.  39,  /*  039  02/07  G0 '    Apostrophe                =>  (self)  */
  523.  40,  /*  040  02/08  G0 (    Left parenthesis          =>  (self)  */
  524.  41,  /*  041  02/09  G0 )    Right parenthesis         =>  (self)  */
  525.  42,  /*  042  02/10  G0 *    Asterisk                  =>  (self)  */
  526.  43,  /*  043  02/11  G0 +    Plus sign                 =>  (self)  */
  527.  44,  /*  044  02/12  G0 ,    Comma                     =>  (self)  */
  528.  45,  /*  045  02/13  G0 -    Hyphen, minus sign        =>  (self)  */
  529.  46,  /*  046  02/14  G0 .    Period, full stop         =>  (self)  */
  530.  47,  /*  047  02/15  G0 /    Slash, solidus            =>  (self)  */
  531.  48,  /*  048  03/00  G0 0    Digit 0                   =>  (self)  */
  532.  49,  /*  049  03/01  G0 1    Digit 1                   =>  (self)  */
  533.  50,  /*  050  03/02  G0 2    Digit 2                   =>  (self)  */
  534.  51,  /*  051  03/03  G0 3    Digit 3                   =>  (self)  */
  535.  52,  /*  052  03/04  G0 4    Digit 4                   =>  (self)  */
  536.  53,  /*  053  03/05  G0 5    Digit 5                   =>  (self)  */
  537.  54,  /*  054  03/06  G0 6    Digit 6                   =>  (self)  */
  538.  55,  /*  055  03/07  G0 7    Digit 7                   =>  (self)  */
  539.  56,  /*  056  03/08  G0 8    Digit 8                   =>  (self)  */
  540.  57,  /*  057  03/09  G0 9    Digit 9                   =>  (self)  */
  541.  58,  /*  058  03/10  G0 :    Colon                     =>  (self)  */
  542.  59,  /*  059  03/11  G0 ;    Semicolon                 =>  (self)  */
  543.  60,  /*  060  03/12  G0 <    Less-than sign            =>  (self)  */
  544.  61,  /*  061  03/13  G0 =    Equals sign               =>  (self)  */
  545.  62,  /*  062  03/14  G0 >    Greater-than sign         =>  (self)  */
  546.  63,  /*  063  03/15  G0 ?    Question mark             =>  (self)  */
  547.  64,  /*  064  04/00  G0 @    Commercial at sign        =>  (self)  */
  548.  65,  /*  065  04/01  G0 A    Letter A                  =>  (self)  */
  549.  66,  /*  066  04/02  G0 B    Letter B                  =>  (self)  */
  550.  67,  /*  067  04/03  G0 C    Letter C                  =>  (self)  */
  551.  68,  /*  068  04/04  G0 D    Letter D                  =>  (self)  */
  552.  69,  /*  069  04/05  G0 E    Letter E                  =>  (self)  */
  553.  70,  /*  070  04/06  G0 F    Letter F                  =>  (self)  */
  554.  71,  /*  071  04/07  G0 G    Letter G                  =>  (self)  */
  555.  72,  /*  072  04/08  G0 H    Letter H                  =>  (self)  */
  556.  73,  /*  073  04/09  G0 I    Letter I                  =>  (self)  */
  557.  74,  /*  074  04/10  G0 J    Letter J                  =>  (self)  */
  558.  75,  /*  075  04/11  G0 K    Letter K                  =>  (self)  */
  559.  76,  /*  076  04/12  G0 L    Letter L                  =>  (self)  */
  560.  77,  /*  077  04/13  G0 M    Letter M                  =>  (self)  */
  561.  78,  /*  078  04/14  G0 N    Letter N                  =>  (self)  */
  562.  79,  /*  079  04/15  G0 O    Letter O                  =>  (self)  */
  563.  80,  /*  080  05/00  G0 P    Letter P                  =>  (self)  */
  564.  81,  /*  081  05/01  G0 Q    Letter Q                  =>  (self)  */
  565.  82,  /*  082  05/02  G0 R    Letter R                  =>  (self)  */
  566.  83,  /*  083  05/03  G0 S    Letter S                  =>  (self)  */
  567.  84,  /*  084  05/04  G0 T    Letter T                  =>  (self)  */
  568.  85,  /*  085  05/05  G0 U    Letter U                  =>  (self)  */
  569.  86,  /*  086  05/06  G0 V    Letter V                  =>  (self)  */
  570.  87,  /*  087  05/07  G0 W    Letter W                  =>  (self)  */
  571.  88,  /*  088  05/08  G0 X    Letter X                  =>  (self)  */
  572.  89,  /*  089  05/09  G0 Y    Letter Y                  =>  (self)  */
  573.  90,  /*  090  05/10  G0 Z    Letter Z                  =>  (self)  */
  574.  91,  /*  091  05/11  G0 [    Left square bracket       =>  (self)  */
  575.  92,  /*  092  05/12  G0 \    Reverse slash             =>  (self)  */
  576.  93,  /*  093  05/13  G0 ]    Right square bracket      =>  (self)  */
  577.  94,  /*  094  05/14  G0 ^    Circumflex accent         =>  (self)  */
  578.  95,  /*  095  05/15  G0 _    Underline, low line       =>  (self)  */
  579.  96,  /*  096  06/00  G0 `    Grave accent              =>  (self)  */
  580.  97,  /*  097  06/01  G0 a    Letter a                  =>  (self)  */
  581.  98,  /*  098  06/02  G0 b    Letter b                  =>  (self)  */
  582.  99,  /*  099  06/03  G0 c    Letter c                  =>  (self)  */
  583. 100,  /*  100  06/04  G0 d    Letter d                  =>  (self)  */
  584. 101,  /*  101  06/05  G0 e    Letter e                  =>  (self)  */
  585. 102,  /*  102  06/06  G0 f    Letter f                  =>  (self)  */
  586. 103,  /*  103  06/07  G0 g    Letter g                  =>  (self)  */
  587. 104,  /*  104  06/08  G0 h    Letter h                  =>  (self)  */
  588. 105,  /*  105  06/09  G0 i    Letter i                  =>  (self)  */
  589. 106,  /*  106  06/10  G0 j    Letter j                  =>  (self)  */
  590. 107,  /*  107  06/11  G0 k    Letter k                  =>  (self)  */
  591. 108,  /*  108  06/12  G0 l    Letter l                  =>  (self)  */
  592. 109,  /*  109  06/13  G0 m    Letter m                  =>  (self)  */
  593. 110,  /*  110  06/14  G0 n    Letter n                  =>  (self)  */
  594. 111,  /*  111  06/15  G0 o    Letter o                  =>  (self)  */
  595. 112,  /*  112  07/00  G0 p    Letter p                  =>  (self)  */
  596. 113,  /*  113  07/01  G0 q    Letter q                  =>  (self)  */
  597. 114,  /*  114  07/02  G0 r    Letter r                  =>  (self)  */
  598. 115,  /*  115  07/03  G0 s    Letter s                  =>  (self)  */
  599. 116,  /*  116  07/04  G0 t    Letter t                  =>  (self)  */
  600. 117,  /*  117  07/05  G0 u    Letter u                  =>  (self)  */
  601. 118,  /*  118  07/06  G0 v    Letter v                  =>  (self)  */
  602. 119,  /*  119  07/07  G0 w    Letter w                  =>  (self)  */
  603. 120,  /*  120  07/08  G0 x    Letter x                  =>  (self)  */
  604. 121,  /*  121  07/09  G0 y    Letter y                  =>  (self)  */
  605. 122,  /*  122  07/10  G0 z    Letter z                  =>  (self)  */
  606. 123,  /*  123  07/11  G0 {    Left curly bracket        =>  (self)  */
  607. 124,  /*  124  07/12  G0 |    Vertical bar              =>  (self)  */
  608. 125,  /*  125  07/13  G0 }    Right curly bracket       =>  (self)  */
  609. 126,  /*  126  07/14  G0 ~    Tilde                     =>  (self)  */
  610. 127,  /*  127  07/15     DEL  Delete, Rubout            =>  (self)  */
  611. UNK,  /*  128  08/00  C1                                =>  UNK     */
  612. UNK,  /*  129  08/01  C1                                =>  UNK     */
  613. UNK,  /*  130  08/02  C1                                =>  UNK     */
  614. UNK,  /*  131  08/03  C1                                =>  UNK     */
  615. UNK,  /*  132  08/04  C1 IND                            =>  UNK     */
  616. UNK,  /*  133  08/05  C1 NEL                            =>  UNK     */
  617. UNK,  /*  134  08/06  C1 SSA                            =>  UNK     */
  618. UNK,  /*  135  08/07  C1 ESA                            =>  UNK     */
  619. UNK,  /*  136  08/08  C1 HTS                            =>  UNK     */
  620. UNK,  /*  137  08/09  C1                                =>  UNK     */
  621. UNK,  /*  138  08/10  C1                                =>  UNK     */
  622. UNK,  /*  139  08/11  C1                                =>  UNK     */
  623. UNK,  /*  140  08/12  C1                                =>  UNK     */
  624. UNK,  /*  141  08/13  C1 RI                             =>  UNK     */
  625. UNK,  /*  142  08/14  C1 SS2                            =>  UNK     */
  626. UNK,  /*  143  08/15  C1 SS3                            =>  UNK     */
  627. UNK,  /*  144  09/00  C1 DCS                            =>  UNK     */
  628. UNK,  /*  145  09/01  C1                                =>  UNK     */
  629. UNK,  /*  146  09/02  C1                                =>  UNK     */
  630. UNK,  /*  147  09/03  C1 STS                            =>  UNK     */
  631. UNK,  /*  148  09/04  C1                                =>  UNK     */
  632. UNK,  /*  149  09/05  C1                                =>  UNK     */
  633. UNK,  /*  150  09/06  C1 SPA                            =>  UNK     */
  634. UNK,  /*  151  09/07  C1 EPA                            =>  UNK     */
  635. UNK,  /*  152  09/08  C1                                =>  UNK     */
  636. UNK,  /*  153  09/09  C1                                =>  UNK     */
  637. UNK,  /*  154  09/10  C1                                =>  UNK     */
  638. UNK,  /*  155  09/11  C1 CSI                            =>  UNK     */
  639. UNK,  /*  156  09/12  C1 ST                             =>  UNK     */
  640. UNK,  /*  157  09/13  C1 OSC                            =>  UNK     */
  641. UNK,  /*  158  09/14  C1 PM                             =>  UNK     */
  642. UNK,  /*  159  09/15  C1 APC                            =>  UNK     */
  643.  32,  /*  160  10/00  G1      No-break space            =>  SP      */
  644.  33,  /*  161  10/01  G1      Inverted exclamation      =>  !       */
  645.  99,  /*  162  10/02  G1      Cent sign                 =>  c       */
  646.  35,  /*  163  10/03  G1      Pound sign                =>  #       */
  647.  36,  /*  164  10/04  G1      Currency sign             =>  $       */
  648.  89,  /*  165  10/05  G1      Yen sign                  =>  Y       */
  649. 124,  /*  166  10/06  G1      Broken bar                =>  |       */
  650.  80,  /*  167  10/07  G1      Paragraph sign            =>  P       */
  651.  34,  /*  168  10/08  G1      Diaeresis                 =>  "       */
  652.  67,  /*  169  10/09  G1      Copyright sign            =>  C       */
  653.  97,  /*  170  10/10  G1      Feminine ordinal          =>  a       */
  654.  34,  /*  171  10/11  G1      Left angle quotation      =>  "       */
  655. 126,  /*  172  10/12  G1      Not sign                  =>  ~       */
  656.  45,  /*  173  10/13  G1      Soft hyphen               =>  -       */
  657.  82,  /*  174  10/14  G1      Registered trade mark     =>  R       */
  658.  95,  /*  175  10/15  G1      Macron                    =>  _       */
  659. 111,  /*  176  11/00  G1      Degree sign, ring above   =>  o       */
  660. UNK,  /*  177  11/01  G1      Plus-minus sign           =>  UNK     */
  661.  50,  /*  178  11/02  G1      Superscript two           =>  2       */
  662.  51,  /*  179  11/03  G1      Superscript three         =>  3       */
  663.  39,  /*  180  11/04  G1      Acute accent              =>  '       */
  664. 117,  /*  181  11/05  G1      Micro sign                =>  u       */
  665.  45,  /*  182  11/06  G1      Pilcrow sign              =>  -       */
  666.  45,  /*  183  11/07  G1      Middle dot                =>  -       */
  667.  44,  /*  184  11/08  G1      Cedilla                   =>  ,       */
  668.  49,  /*  185  11/09  G1      Superscript one           =>  1       */
  669. 111,  /*  186  11/10  G1      Masculine ordinal         =>  o       */
  670.  34,  /*  187  11/11  G1      Right angle quotation     =>  "       */
  671. UNK,  /*  188  11/12  G1      One quarter               =>  UNK     */
  672. UNK,  /*  189  11/13  G1      One half                  =>  UNK     */
  673. UNK,  /*  190  11/14  G1      Three quarters            =>  UNK     */
  674.  63,  /*  191  11/15  G1      Inverted question mark    =>  ?       */
  675.  65,  /*  192  12/00  G1      A grave                   =>  A       */
  676.  65,  /*  193  12/01  G1      A acute                   =>  A       */
  677.  65,  /*  194  12/02  G1      A circumflex              =>  A       */
  678.  65,  /*  195  12/03  G1      A tilde                   =>  A       */
  679.  65,  /*  196  12/04  G1      A diaeresis               =>  A       */
  680.  65,  /*  197  12/05  G1      A ring above              =>  A       */
  681.  65,  /*  198  12/06  G1      A with E                  =>  A       */
  682.  67,  /*  199  12/07  G1      C Cedilla                 =>  C       */
  683.  69,  /*  200  12/08  G1      E grave                   =>  E       */
  684.  69,  /*  201  12/09  G1      E acute                   =>  E       */
  685.  69,  /*  202  12/10  G1      E circumflex              =>  E       */
  686.  69,  /*  203  12/11  G1      E diaeresis               =>  E       */
  687.  73,  /*  204  12/12  G1      I grave                   =>  I       */
  688.  73,  /*  205  12/13  G1      I acute                   =>  I       */
  689.  73,  /*  206  12/14  G1      I circumflex              =>  I       */
  690.  73,  /*  207  12/15  G1      I diaeresis               =>  I       */
  691.  68,  /*  208  13/00  G1      Icelandic Eth             =>  D       */
  692.  78,  /*  209  13/01  G1      N tilde                   =>  N       */
  693.  79,  /*  210  13/02  G1      O grave                   =>  O       */
  694.  79,  /*  211  13/03  G1      O acute                   =>  O       */
  695.  79,  /*  212  13/04  G1      O circumflex              =>  O       */
  696.  79,  /*  213  13/05  G1      O tilde                   =>  O       */
  697.  79,  /*  214  13/06  G1      O diaeresis               =>  O       */
  698. 120,  /*  215  13/07  G1      Multiplication sign       =>  x       */
  699.  79,  /*  216  13/08  G1      O oblique stroke          =>  O       */
  700.  85,  /*  217  13/09  G1      U grave                   =>  U       */
  701.  85,  /*  218  13/10  G1      U acute                   =>  U       */
  702.  85,  /*  219  13/11  G1      U circumflex              =>  U       */
  703.  85,  /*  220  13/12  G1      U diaeresis               =>  U       */
  704.  89,  /*  221  13/13  G1      Y acute                   =>  Y       */
  705.  84,  /*  222  13/14  G1      Icelandic Thorn           =>  T       */
  706. 115,  /*  223  13/15  G1      German sharp s            =>  s       */
  707.  97,  /*  224  14/00  G1      a grave                   =>  a       */
  708.  97,  /*  225  14/01  G1      a acute                   =>  a       */
  709.  97,  /*  226  14/02  G1      a circumflex              =>  a       */
  710.  97,  /*  227  14/03  G1      a tilde                   =>  a       */
  711.  97,  /*  228  14/04  G1      a diaeresis               =>  a       */
  712.  97,  /*  229  14/05  G1      a ring above              =>  a       */
  713.  97,  /*  230  14/06  G1      a with e                  =>  a       */
  714.  99,  /*  231  14/07  G1      c cedilla                 =>  c       */
  715. 101,  /*  232  14/08  G1      e grave                   =>  e       */
  716. 101,  /*  233  14/09  G1      e acute                   =>  e       */
  717. 101,  /*  234  14/10  G1      e circumflex              =>  e       */
  718. 101,  /*  235  14/11  G1      e diaeresis               =>  e       */
  719. 105,  /*  236  14/12  G1      i grave                   =>  i       */
  720. 105,  /*  237  14/13  G1      i acute                   =>  i       */
  721. 105,  /*  238  14/14  G1      i circumflex              =>  i       */
  722. 105,  /*  239  14/15  G1      i diaeresis               =>  i       */
  723. 100,  /*  240  15/00  G1      Icelandic eth             =>  d       */
  724. 110,  /*  241  15/01  G1      n tilde                   =>  n       */
  725. 111,  /*  242  15/02  G1      o grave                   =>  o       */
  726. 111,  /*  243  15/03  G1      o acute                   =>  o       */
  727. 111,  /*  244  15/04  G1      o circumflex              =>  o       */
  728. 111,  /*  245  15/05  G1      o tilde                   =>  o       */
  729. 111,  /*  246  15/06  G1      o diaeresis               =>  o       */
  730.  47,  /*  247  15/07  G1      Division sign             =>  /       */
  731. 111,  /*  248  15/08  G1      o oblique stroke          =>  o       */
  732. 117,  /*  249  15/09  G1      u grave                   =>  u       */
  733. 117,  /*  250  15/10  G1      u acute                   =>  u       */
  734. 117,  /*  251  15/11  G1      u circumflex              =>  u       */
  735. 117,  /*  252  15/12  G1      u diaeresis               =>  u       */
  736. 121,  /*  253  15/13  G1      y acute                   =>  y       */
  737. 116,  /*  254  15/14  G1      Icelandic thorn           =>  t       */
  738. 121   /*  255  15/15  G1      y diaeresis               =>  y       */
  739. };
  740.  
  741.  
  742. /* Translation tables for ISO Latin Alphabet 1 to local file character sets */
  743.  
  744. /*
  745.   Most of the remaining tables are not annotated like the one above, because
  746.   the size of the resulting source file would be ridiculous.  Each row in the
  747.   following tables corresponds to a column of ISO 8859-1.
  748. */
  749.  
  750. CHAR
  751. yl185[] = {  /* ISO 8859-1 Latin Alphabet 1 (Latin-1) to IBM Code Page 850 */
  752. /*
  753.   This is IBM's official invertible translation.  Reference: IBM Character
  754.   Data Representation Architecture (CDRA), Level 1, Registry, SC09-1291-00
  755.   (1990), p.152.  (Note: Latin-1 is IBM Code Page 00819.)  Note: IBM's bizarre
  756.   rearrangement of C0 controls and DEL has been undone in this table.
  757. */
  758.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  759.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  760.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  761.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  762.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  763.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  764.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  765. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  766. 186, 205, 201, 187, 200, 188, 204, 185, 203, 202, 206, 223, 220, 219, 254, 242,
  767. 179, 196, 218, 191, 192, 217, 195, 180, 194, 193, 197, 176, 177, 178, 213, 159,
  768. 255, 173, 189, 156, 207, 190, 221, 245, 249, 184, 166, 174, 170, 240, 169, 238,
  769. 248, 241, 253, 252, 239, 230, 244, 250, 247, 251, 167, 175, 172, 171, 243, 168,
  770. 183, 181, 182, 199, 142, 143, 146, 128, 212, 144, 210, 211, 222, 214, 215, 216,
  771. 209, 165, 227, 224, 226, 229, 153, 158, 157, 235, 233, 234, 154, 237, 232, 225,
  772. 133, 160, 131, 198, 132, 134, 145, 135, 138, 130, 136, 137, 141, 161, 140, 139,
  773. 208, 164, 149, 162, 147, 228, 148, 246, 155, 151, 163, 150, 129, 236, 231, 152
  774. };
  775.  
  776. CHAR
  777. y85l1[] = {  /* IBM Code Page 850 to Latin-1 */
  778. /*
  779.   This is from IBM CDRA page 153.  It is the inverse of yl185[].
  780.   As of edit 183, this table is no longer pure CDRA.  The translations 
  781.   involving C0 controls and DEL have been removed.
  782. */
  783.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  784.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  785.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  786.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  787.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  788.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  789.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  790. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  791. 199, 252, 233, 226, 228, 224, 229, 231, 234, 235, 232, 239, 238, 236, 196, 197,
  792. 201, 230, 198, 244, 246, 242, 251, 249, 255, 214, 220, 248, 163, 216, 215, 159,
  793. 225, 237, 243, 250, 241, 209, 170, 186, 191, 174, 172, 189, 188, 161, 171, 187,
  794. 155, 156, 157, 144, 151, 193, 194, 192, 169, 135, 128, 131, 133, 162, 165, 147,
  795. 148, 153, 152, 150, 145, 154, 227, 195, 132, 130, 137, 136, 134, 129, 138, 164,
  796. 240, 208, 202, 203, 200, 158, 205, 206, 207, 149, 146, 141, 140, 166, 204, 139,
  797. 211, 223, 212, 210, 245, 213, 181, 254, 222, 218, 219, 217, 253, 221, 175, 180,
  798. 173, 177, 143, 190, 182, 167, 247, 184, 176, 168, 183, 185, 179, 178, 142, 160
  799. };
  800.  
  801. CHAR
  802. yl143[] = {  /* Latin-1 to IBM Code Page 437 */
  803. /*
  804.   Although the IBM CDRA does not include an official translation between CP437
  805.   and ISO Latin Alphabet 1, it does include an official, invertible
  806.   translation between CP437 and CP850 (page 196), and another from CP850 to
  807.   Latin-1 (CP819) (page 153).  This translation was obtained with a two-step
  808.   process based on those tables.
  809.   As of edit 183, the translation is modified to leave C0 controls alone.
  810. */
  811.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  812.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  813.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  814.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  815.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  816.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  817.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  818. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  819. 186, 205, 201, 187, 200, 188, 204, 185, 203, 202, 206, 223, 220, 219, 254, 242,
  820. 179, 196, 218, 191, 192, 217, 195, 180, 194, 193, 197, 176, 177, 178, 213, 159,
  821. 255, 173, 155, 156, 207, 157, 221, 245, 249, 184, 166, 174, 170, 240, 169, 238,
  822. 248, 241, 253, 252, 239, 230, 244, 250, 247, 251, 167, 175, 172, 171, 243, 168,
  823. 183, 181, 182, 199, 142, 143, 146, 128, 212, 144, 210, 211, 222, 214, 215, 216,
  824. 209, 165, 227, 224, 226, 229, 153, 158, 190, 235, 233, 234, 154, 237, 232, 225,
  825. 133, 160, 131, 198, 132, 134, 145, 135, 138, 130, 136, 137, 141, 161, 140, 139,
  826. 208, 164, 149, 162, 147, 228, 148, 246, 189, 151, 163, 150, 129, 236, 231, 152
  827. };
  828.  
  829. CHAR
  830. y43l1[] = {  /* IBM Code Page 437 to Latin-1 */
  831. /*
  832.   This table is the inverse of yl143[].
  833. */
  834.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  835.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  836.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  837.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  838.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  839.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  840.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  841. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  842. 199, 252, 233, 226, 228, 224, 229, 231, 234, 235, 232, 239, 238, 236, 196, 197,
  843. 201, 230, 198, 244, 246, 242, 251, 249, 255, 214, 220, 162, 163, 165, 215, 159,
  844. 225, 237, 243, 250, 241, 209, 170, 186, 191, 174, 172, 189, 188, 161, 171, 187,
  845. 155, 156, 157, 144, 151, 193, 194, 192, 169, 135, 128, 131, 133, 248, 216, 147,
  846. 148, 153, 152, 150, 145, 154, 227, 195, 132, 130, 137, 136, 134, 129, 138, 164,
  847. 240, 208, 202, 203, 200, 158, 205, 206, 207, 149, 146, 141, 140, 166, 204, 139,
  848. 211, 223, 212, 210, 245, 213, 181, 254, 222, 218, 219, 217, 253, 221, 175, 180,
  849. 173, 177, 143, 190, 182, 167, 247, 184, 176, 168, 183, 185, 179, 178, 142, 160
  850. };
  851.  
  852. CHAR
  853. yl1aq[] = {  /* Latin-1 to Extended Mac Latin (based on Apple QuickDraw) */
  854.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  855.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  856.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  857.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  858.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  859.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  860.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  861. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  862. 182, 183, 184, 185, 189, 196, 197, 198, 206, 207, 210, 211, 217, 218, 195, 212,
  863. 209, 215, 213, 226, 227, 228, 240, 245, 246, 247, 249, 250, 251, 253, 254, 255,
  864. 202, 193, 162, 163, 219, 180, 201, 164, 172, 169, 187, 199, 194, 208, 168, 248,
  865. 161, 177, 170, 173, 171, 181, 166, 225, 252, 176, 188, 200, 178, 179, 186, 192,
  866. 203, 231, 229, 204, 128, 129, 174, 130, 233, 131, 230, 232, 237, 234, 235, 236,
  867. 220, 132, 241, 238, 239, 205, 133, 165, 175, 244, 242, 243, 134, 160, 222, 167,
  868. 136, 135, 137, 139, 138, 140, 190, 141, 143, 142, 144, 145, 147, 146, 148, 149,
  869. 221, 150, 152, 151, 153, 155, 154, 214, 191, 157, 156, 158, 159, 224, 223, 216
  870. };
  871.  
  872. CHAR
  873. yl1du[] = {  /* Latin-1 to Dutch ISO 646 */
  874.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  875.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  876.  32,  33,  34, UNK,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  877.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  878. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  879.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  880.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  881. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK,  39, 127,
  882. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  883. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  884.  32,  33, UNK,  35, 124, UNK, UNK,  93, 123,  67, UNK,  34, UNK,  45,  82, UNK,
  885.  91, UNK, UNK, UNK, 126, 117, UNK, UNK,  44, UNK, UNK,  34, 125,  92,  64,  63,
  886.  65,  65,  65,  65,  91,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  887. UNK,  78,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  888.  97,  97,  97,  97,  97,  97,  97,  99, 101, 101, 101, 101, 105, 105, 105, 105,
  889. UNK, 110, 111, 111, 111, 111, 111,  47, 111, 117, 117, 117, 117, 121, UNK,  91
  890. };
  891.  
  892. CHAR
  893. yl1fi[] = {  /* Latin-1 to Finnish ISO 646 */
  894.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  895.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  896.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  897.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  898.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  899.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK, UNK,  95,
  900. UNK,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  901. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, UNK,
  902. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  903. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  904.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  905. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  906.  65,  65,  65,  65,  91,  93,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  907. UNK,  78,  79,  79,  79,  79,  92, 120,  79,  85,  85,  85,  94,  89, UNK, 115,
  908.  97,  97,  97,  97, 123, 125,  97,  99, 101,  96, 101, 101, 105, 105, 105, 105,
  909. UNK, 110, 111, 111, 111, 111, 124,  47, 111, 117, 117, 117, 126, 121, UNK, 121
  910. };
  911.  
  912. CHAR
  913. yl1fr[] = {  /* Latin-1 to French ISO 646 */
  914.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  915.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  916.  32,  33,  34, UNK,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  917.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  918. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  919.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  920.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  921. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  922. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  923. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  924.  32,  33, UNK,  35, UNK, UNK, UNK,  93,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  925.  91, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  926.  65,  65,  65,  65,  65,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  927. UNK,  78,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  928.  64,  97,  97,  97,  97,  97,  97,  92, 125, 123, 101, 101, 105, 105, 105, 105,
  929. UNK, 110, 111, 111, 111, 111, 111,  47, 111, 124, 117, 117, 117, 121, UNK, 121
  930. };
  931.  
  932. CHAR
  933. yl1fc[] = {  /* Latin-1 to French-Canadian ISO 646 */
  934.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  935.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  936.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  937.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  938. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  939.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK, UNK,  95,
  940. UNK,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  941. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  942. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  943. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  944.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  945. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  946.  65,  65,  65,  65,  65,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  947. UNK,  78,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  948.  64,  97,  91,  97,  97,  97,  97,  92, 125, 123,  93, 101, 105, 105,  94, 105,
  949. UNK, 110, 111, 111,  96, 111, 111,  47, 111, 124, 117, 126, 117, 121, UNK, 121
  950. };
  951.  
  952. CHAR
  953. yl1ge[] = {  /* Latin-1 to German ISO 646 */
  954.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  955.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  956.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  957.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  958. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  959.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  960.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  961. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  962. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  963. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  964.  32,  33, UNK, UNK, UNK, UNK, UNK,  64,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  965. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  966.  65,  65,  65,  65,  91,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  967. UNK,  78,  79,  79,  79,  79,  92, 120,  79,  85,  85,  85,  93,  89, UNK, 126,
  968.  97,  97,  97,  97, 123,  97,  97,  99, 101, 101, 101, 101, 105, 105, 105, 105,
  969. UNK, 110, 111, 111, 111, 111, 124,  47, 111, 117, 117, 117, 125, 121, UNK, 121
  970. };
  971.  
  972. CHAR
  973. yl1hu[] = {  /* Latin-1 to Hungarian ISO-646 */
  974.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  975.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  976.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  977.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  978.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  979.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  980.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  981. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  982. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  983. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  984.  32,  33, UNK, UNK,  36, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  985. UNK,  64, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  986.  65,  65,  65,  65,  65,  65,  65,  67,  69,  91,  69,  69,  73,  73,  73,  73,
  987. UNK,  78,  79,  79,  79,  79,  92, 120,  79,  85,  85,  85,  93,  89, UNK, 115,
  988.  97,  96,  97,  97,  97,  97,  97,  99, 101, 123, 101, 101, 105, 105, 105, 105,
  989. UNK, 110, 111, 111, 111, 111, 124,  47, 111, 117, 117, 117, 125, 121, UNK, 121
  990. };
  991.  
  992. CHAR
  993. yl1it[] = {  /* Latin-1 to Italian ISO 646 */
  994.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  995.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  996.  32,  33,  34, UNK,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  997.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  998. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  999.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  1000. UNK,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1001. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1002. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1003. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1004.  32,  33, UNK,  35, UNK, UNK, UNK,  64,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1005.  91, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1006.  65,  65,  65,  65,  65,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1007. UNK,  78,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  1008. 123,  97,  97,  97,  97,  97,  97,  92, 125,  93, 101, 101, 126, 105, 105, 105,
  1009. UNK, 110, 124, 111, 111, 111, 111,  47, 111,  96, 117, 117, 117, 121, UNK, 121
  1010. };
  1011.  
  1012. CHAR
  1013. yl1ne[] = {  /* Latin-1 to NeXT */
  1014. /* NEED TO MAKE THIS ONE INVERTIBLE, LIKE CP850 */
  1015. /*
  1016.   Which means finding all the graphic characters in the NeXT set that have
  1017.   no equivalent in Latin-1 and assigning them to the UNK positions (mostly
  1018.   Latin-1 C1 controls).  Then make the ynel1[] table be the inverse of this
  1019.   one.  But first we should try to get an official Latin-1/NeXT translation
  1020.   table from NeXT, Inc.
  1021. */
  1022.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1023.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1024.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1025.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1026.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1027.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1028.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1029. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1030. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1031. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1032.  32, 161, 162, 163, 168, 165, 181, 167, 200, 160, 227, 171, 190, UNK, 176, 197,
  1033. 202, 209, 201, 204, 194, 157, 182, 183, 203, 192, 235, 187, 210, 211, 212, 191,
  1034. 129, 130, 131, 132, 133, 134, 225, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1035. 144, 145, 146, 147, 148, 149, 150, 158, 233, 151, 152, 153, 154, 155, 156, 251,
  1036. 213, 214, 215, 216, 217, 218, 241, 219, 220, 221, 222, 223, 224, 226, 228, 229,
  1037. 230, 231, 236, 237, 238, 239, 240, 159, 249, 242, 243, 244, 246, 247, 252, 253
  1038. };
  1039.  
  1040. CHAR
  1041. yl1no[] = {  /* Latin-1 to Norwegian/Danish ISO 646 */
  1042.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1043.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1044.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1045.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1046.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1047.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  1048.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1049. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, 126, 127,
  1050. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1051. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1052.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1053. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1054.  65,  65,  65,  65,  65,  93,  91,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1055. UNK,  78,  79,  79,  79,  79,  79, 120,  92,  85,  85,  85,  85,  89, UNK, 115,
  1056.  97,  97,  97,  97,  97, 125, 123,  99, 101, 101, 101, 101, 105, 105, 105, 105,
  1057. UNK, 110, 111, 111, 111, 111, 111,  47, 124, 117, 117, 117, 117, 121, UNK, 121
  1058. };
  1059.  
  1060. CHAR
  1061. yl1po[] = {  /* Latin-1 to Portuguese ISO 646 */
  1062.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1063.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1064.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1065.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1066.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1067.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  1068.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1069. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, 126, 127,
  1070. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1071. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1072.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1073. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1074.  65,  65,  65,  91,  65,  65,  65,  92,  69,  69,  69,  69,  73,  73,  73,  73,
  1075. UNK,  78,  79,  79,  79,  93,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  1076.  97,  97,  97, 123,  97,  97,  97, 124, 101, 101, 101, 101, 105, 105, 105, 105,
  1077. UNK, 110, 111, 111, 111, 125, 111,  47, 111, 117, 117, 117, 117, 121, UNK, 121
  1078. };
  1079.  
  1080. CHAR
  1081. yl1sp[] = {  /* Latin-1 to Spanish ISO 646 */
  1082.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1083.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1084.  32,  33,  34, UNK,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1085.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1086. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1087.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK,  94,  95,
  1088.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1089. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,  96, UNK, UNK, 126, 127,
  1090. 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1091. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1092.  32,  91, UNK,  35, UNK, UNK, UNK,  64,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1093. 123, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  93,
  1094.  65,  65,  65,  65,  65,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1095. UNK,  92,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  1096. 124,  97,  97,  97,  97,  97,  97, 125, 101, 101, 101, 101, 105, 105, 105, 105,
  1097. UNK, 124, 111, 111, 111, 111, 111,  47, 111, 117, 117, 117, 117, 121, UNK, 121
  1098. };
  1099.  
  1100. CHAR
  1101. yl1sw[] = {  /* Latin-1 to Swedish ISO 646 */
  1102.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1103.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1104.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1105.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1106. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1107.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK, UNK,  95,
  1108. UNK,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1109. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1110. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1111. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1112.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1113. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1114.  65,  65,  65,  65,  91,  93,  65,  67,  69,  64,  69,  69,  73,  73,  73,  73,
  1115. UNK,  78,  79,  79,  79,  79,  92, 120,  79,  85,  85,  85,  94,  89, UNK, 115,
  1116.  97,  97,  97,  97, 123, 125,  97,  99, 101,  96, 101, 101, 105, 105, 105, 105,
  1117. UNK, 110, 111, 111, 111, 111, 124,  47, 111, 117, 117, 117, 126, 121, UNK, 121
  1118. };
  1119.  
  1120. CHAR
  1121. yl1ch[] = {  /* Latin-1 to Swiss ISO 646 */
  1122.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1123.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1124.  32,  33,  34, UNK,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1125.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1126. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1127.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, UNK, UNK, UNK, UNK, UNK,
  1128.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1129. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, 127,
  1130. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1131. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1132.  32,  33, UNK, UNK, UNK, UNK, UNK, UNK,  34,  67, UNK,  34, UNK,  45,  82, UNK,
  1133. UNK, UNK, UNK, UNK,  39, 117, UNK, UNK,  44, UNK, UNK,  34, UNK, UNK, UNK,  63,
  1134.  65,  65,  65,  65,  65,  65,  65,  67,  69,  69,  69,  69,  73,  73,  73,  73,
  1135. UNK,  78,  79,  79,  79,  79,  79, 120,  79,  85,  85,  85,  85,  89, UNK, 115,
  1136.  64,  97,  97,  97, 123,  97,  97,  92,  95,  91,  93, 101, 105, 105,  94, 105,
  1137. UNK, 110, 111, 111,  96, 111, 124,  47, 111,  35, 117, 126, 125, 121, UNK, 121
  1138. };
  1139.  
  1140. CHAR
  1141. yl1dm[] = {  /* Latin-1 to DEC Multinational Character Set */
  1142.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1143.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1144.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1145.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1146.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1147.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1148.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1149. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1150. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1151. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1152.  32, 161, 162, 163, 168, 165, 124, 167,  34, 169, 170, 171, 126, UNK,  82, UNK,
  1153. 176, 177, 178, 179,  39, 181, 182, 183,  44, 185, 186, 187, 188, 189, UNK, 191,
  1154. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1155. UNK, 209, 210, 211, 212, 213, 214, 120, 216, 217, 218, 219, 220, 221, UNK, 223,
  1156. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1157. UNK, 241, 242, 243, 244, 245, 246,  47, 248, 249, 250, 251, 252, UNK, UNK, 253
  1158. };
  1159.  
  1160. CHAR
  1161. yl1dg[] = {  /* Latin-1 to Data General International Character Set */
  1162.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1163.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1164.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1165.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1166.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1167.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1168.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1169. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1170. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1171. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1172. 160, 171, 167, 168, 166, 181, 191, 187, 189, 173, 169, 177, 161, 255, 174, 175,
  1173. 188, 182, 164, 165, 190, 163, 178, 185, 186, 179, 170, 176, 223, 162, 220, 172,
  1174. 193, 192, 194, 196, 195, 197, 198, 199, 201, 200, 202, 203, 205, 204, 206, 207,
  1175. 184, 208, 210, 209, 211, 213, 212, 215, 214, 217, 216, 218, 219, 221, 222, 252,
  1176. 225, 224, 226, 228, 227, 229, 230, 231, 233, 232, 234, 235, 237, 236, 238, 239,
  1177. 183, 240, 242, 241, 243, 245, 244, 247, 246, 249, 248, 250, 251, 180, 254, 253
  1178. };
  1179.  
  1180.  
  1181. /* Local file character sets to ISO Latin Alphabet 1 */
  1182.  
  1183. #ifdef NOTUSED
  1184. CHAR
  1185. yasl1[] = {  /* ASCII to Latin-1 */
  1186.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1187.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1188.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1189.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1190.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1191.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1192.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1193. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127
  1194. };
  1195. #endif /* NOTUSED */
  1196.  
  1197. CHAR
  1198. yaql1[] = {  /* Extended Mac Latin (based on Apple Quickdraw) to Latin-1 */
  1199.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1200.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1201.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1202.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1203.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1204.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1205.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1206. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1207. 196, 197, 199, 201, 209, 214, 220, 225, 224, 226, 228, 227, 229, 231, 233, 232,
  1208. 234, 235, 237, 236, 238, 239, 241, 243, 242, 244, 246, 245, 250, 249, 251, 252,
  1209. 221, 176, 162, 163, 167, 215, 182, 223, 174, 169, 178, 180, 168, 179, 198, 216,
  1210. 185, 177, 188, 189, 165, 181, 128, 129, 130, 131, 190, 170, 186, 132, 230, 248,
  1211. 191, 161, 172, 142, 133, 134, 135, 171, 187, 166, 160, 192, 195, 213, 136, 137,
  1212. 173, 144, 138, 139, 143, 146, 247, 145, 255, 140, 141, 164, 208, 240, 222, 254,
  1213. 253, 183, 147, 148, 149, 194, 202, 193, 203, 200, 205, 206, 207, 204, 211, 212,
  1214. 150, 210, 218, 219, 217, 151, 152, 153, 175, 154, 155, 156, 184, 157, 158, 159
  1215. };
  1216.  
  1217. CHAR
  1218. ydul1[] = {  /* Dutch ISO 646 to Latin-1 */
  1219.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1220.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1221.  32,  33,  34, 163,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1222.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1223. 190,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1224.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 255, 189, 124,  94,  95,
  1225.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1226. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 168, 164, 188,  39, 127
  1227. };
  1228.  
  1229. CHAR
  1230. yfil1[] = {  /* Finnish ISO 646 to Latin-1 */
  1231.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1232.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1233.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1234.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1235.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1236.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 196, 214, 197, 220,  95,
  1237. 233,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1238. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 228, 246, 229, 252, 127
  1239. };
  1240.  
  1241. CHAR
  1242. yfrl1[] = {  /* French ISO 646 to Latin-1 */
  1243.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1244.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1245.  32,  33,  34, 163,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1246.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1247. 224,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1248.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 176, 231, 167,  94,  95,
  1249.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1250. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 233, 249, 232, 168, 127
  1251. };
  1252.  
  1253. CHAR
  1254. yfcl1[] = {  /* French-Canadian ISO 646 to Latin-1 */
  1255.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1256.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1257.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1258.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1259. 224,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1260.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 226, 231, 234, 238,  95,
  1261. 244,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1262. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 233, 249, 232, 251, 127
  1263. };
  1264.  
  1265. CHAR
  1266. ygel1[] = {  /* German ISO 646 to Latin-1 */
  1267.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1268.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1269.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1270.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1271. 167,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1272.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 196, 214, 220,  94,  95,
  1273.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1274. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 228, 246, 252, 223, 127
  1275. };
  1276.  
  1277. CHAR
  1278. yitl1[] = {  /* Italian ISO 646 to Latin-1 */
  1279.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1280.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1281.  32,  33,  34, 163,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1282.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1283. 167,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1284.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 176, 231, 233,  94,  95,
  1285. 249,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1286. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 224, 242, 232, 236, 127
  1287. };
  1288.  
  1289. CHAR
  1290. ynel1[] = {  /* NeXT to Latin-1 */
  1291. /* NEED TO MAKE THIS ONE INVERTIBLE */
  1292.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1293.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1294.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1295.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1296.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1297.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1298.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1299. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1300. 160, 192, 193, 194, 195, 196, 197, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1301. 208, 209, 210, 211, 212, 213, 214, 217, 218, 219, 220, 221, 222, 181, 215, 247,
  1302. 169, 161, 162, 163, UNK, 165, UNK, 167, 164, UNK, UNK, 171, UNK, UNK, UNK, UNK,
  1303. 174, UNK, UNK, UNK, 183, 166, 182, UNK, UNK, UNK, UNK, 187, UNK, UNK, 172, 191,
  1304. 185,  96, 180,  94, 126, 175, UNK, UNK, 168, 178, 176, 184, 179, UNK, UNK, UNK,
  1305. UNK, 177, 188, 189, 190, 224, 225, 226, 227, 228, 229, 231, 232, 233, 234, 235,
  1306. 236, 198, 237, 170, 238, 239, 240, 241, UNK, 216, UNK, 186, 242, 243, 244, 245,
  1307. 246, 230, 249, 250, 251, UNK, 252, 253, UNK, 248, UNK, 223, 254, 255, UNK, UNK
  1308. };
  1309.  
  1310. CHAR
  1311. ynol1[] = {  /* Norwegian/Danish ISO 646 to Latin-1 */
  1312.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1313.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1314.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1315.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1316.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1317.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 198, 216, 197,  94,  95,
  1318.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1319. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 230, 248, 229, 126, 127
  1320. };
  1321.  
  1322. CHAR
  1323. ypol1[] = {  /* Portuguese ISO 646 to Latin-1 */
  1324.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1325.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1326.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1327.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1328.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1329.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 195, 199, 213,  94,  95,
  1330.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1331. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 227, 231, 245, 126, 127
  1332. };
  1333.  
  1334. CHAR
  1335. yspl1[] = {  /* Spanish ISO 646 to Latin-1 */
  1336.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1337.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1338.  32,  33,  34, 163,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1339.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1340. 167,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1341.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 161, 209, 191,  94,  95,
  1342.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1343. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 176, 241, 231, 126, 127
  1344. };
  1345.  
  1346. CHAR
  1347. yswl1[] = {  /* Swedish ISO 646 to Latin-1 */
  1348.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1349.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1350.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1351.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1352. 201,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1353.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 196, 214, 197, 220,  95,
  1354. 233,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1355. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 228, 246, 229, 252, 127
  1356. };
  1357.  
  1358. CHAR
  1359. ychl1[] = {  /* Swiss ISO 646 to Latin-1 */
  1360.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1361.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1362.  32,  33,  34, 249,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1363.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1364. 224,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1365.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 233, 231, 234, 238, 232,
  1366. 244,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1367. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 228, 246, 252, 251, 127
  1368. };
  1369.  
  1370. CHAR
  1371. yhul1[] = {  /* Hungarian ISO 646 to Latin-1 */
  1372.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1373.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1374.  32,  33,  34,  35, 164,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1375.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1376. 193,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1377.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 201, 214, 220,  94,  95,
  1378. 225,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1379. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 233, 246, 252,  34, 127
  1380. };
  1381.  
  1382. CHAR
  1383. ydml1[] = {  /* DEC Multinational Character Set to Latin-1 */
  1384.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1385.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1386.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1387.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1388.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1389.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1390.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1391. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1392. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1393. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1394. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
  1395. 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
  1396. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1397. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1398. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1399. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
  1400. };
  1401.  
  1402. CHAR
  1403. ydgl1[] = {  /* Data General International to Latin-1 */
  1404.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1405.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1406.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1407.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1408.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1409.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1410.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1411. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1412. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1413. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1414. 160, 172, 189, 181, 178, 179, 164, 162, 163, 170, 186, 161, 191, 169, 174, 175,
  1415. 187, 171, 182, 185, 253, 165, 177, 240, 208, 183, 184, 167, 176, 168, 180, 166,
  1416. 193, 192, 194, 196, 195, 197, 198, 199, 201, 200, 202, 203, 205, 204, 206, 207,
  1417. 209, 211, 210, 212, 214, 213, 216, 215, 218, 217, 219, 220, 190, 221, 222, 188,
  1418. 225, 224, 226, 228, 227, 229, 230, 231, 233, 232, 234, 235, 237, 236, 238, 239,
  1419. 241, 243, 242, 244, 246, 245, 248, 247, 250, 249, 251, 252, 223, 255, 254, 173
  1420. };
  1421.  
  1422.  
  1423. /* Translation tables for Cyrillic character sets */
  1424.  
  1425. #ifdef CYRILLIC
  1426. CHAR
  1427. ylcac[] = {  /* Latin/Cyrillic to CP866 */
  1428.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1429.  16,  17,  18,  19, 208, 209,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1430.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1431.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1432.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1433.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1434.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1435. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1436. 196, 179, 192, 217, 191, 218, 195, 193, 180, 194, 197, 176, 177, 178, 211, 216,
  1437. 205, 186, 200, 188, 187, 201, 204, 202, 185, 203, 206, 223, 220, 219, 254, UNK,
  1438. 255, 240, 132, 131, 242,  83,  73, 244,  74, 139, 141, 151, 138,  45, 246, 135,
  1439. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1440. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1441. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
  1442. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1443. 252, 241, 164, 163, 243, 115, 105, 245, 106, 171, 173, 231, 170,  21, 247, 167
  1444. };
  1445.  
  1446. CHAR
  1447. ylck8[] = {  /* Latin/Cyrillic to Old KOI-8 Cyrillic */
  1448.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1449.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1450.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1451.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1452.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1453.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1454.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1455. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1456. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1457. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1458. UNK, 229, UNK, UNK, UNK,  83,  73,  73,  74, UNK, UNK, UNK, 235, UNK, 245, UNK,
  1459. 225, 226, 247, 231, 228, 229, 246, 250, 233, 234, 235, 236, 237, 238, 239, 240,
  1460. 242, 243, 244, 245, 230, 232, 227, 254, 251, 253, 255, 249, 248, 252, 224, 241,
  1461. 193, 194, 215, 199, 196, 197, 214, 218, 201, 202, 203, 204, 205, 206, 207, 208,
  1462. 210, 211, 212, 213, 198, 200, 195, 222, 219, 221, 223, 217, 216, 220, 192, 209,
  1463. UNK, 197, UNK, UNK, UNK, 115, 105, 105, 106, UNK, UNK, UNK, 203, UNK, 213, UNK
  1464. };
  1465.  
  1466. CHAR
  1467. yaclc[] = {  /* CP866 to Latin/Cyrillic */
  1468. /* NEED TO MAKE THIS ONE INVERTIBLE */
  1469.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1470.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1471.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1472.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1473.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1474.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1475.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1476. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1477. 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
  1478. 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
  1479. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1480. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1481. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1482. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1483. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1484. 161, 241, 164, 244, 167, 247, 174, 254, UNK, UNK, UNK, UNK, 240, UNK, UNK, UNK
  1485. };
  1486.  
  1487. CHAR
  1488. yk8lc[] = {  /* Old KOI-8 Cyrillic to Latin/Cyrillic */
  1489.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1490.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1491.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1492.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1493.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1494.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1495.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1496. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1497. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1498. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1499. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1500. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1501. 238, 208, 209, 230, 212, 213, 228, 211, 229, 216, 217, 218, 219, 220, 221, 222,
  1502. 223, 239, 224, 225, 226, 227, 214, 210, 236, 235, 215, 232, 237, 233, 231, 234,
  1503. 206, 176, 177, 198, 180, 181, 196, 179, 197, 184, 185, 186, 187, 188, 189, 190,
  1504. 191, 207, 192, 193, 194, 195, 182, 178, 204, 203, 183, 200, 205, 201, 199, 127
  1505. };
  1506.  
  1507. CHAR
  1508. ylcsk[] = {  /* Latin/Cyrillic to Short KOI */
  1509.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1510.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1511.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1512.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1513.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1514.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1515.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1516.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94, 127,
  1517.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1518.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1519.  32, 101, UNK, UNK, UNK,  83,  73,  73,  74, UNK, UNK, UNK, 107,  45, 117, UNK,
  1520.  97,  98, 119, 103, 100, 101, 118, 122, 105, 106, 107, 108, 109, 110, 111, 112,
  1521. 114, 115, 116, 117, 102, 104,  99, 126, 123, 125,  39, 121, 120, 124,  96, 113,
  1522.  97,  98, 119, 103, 100, 101, 118, 122, 105, 106, 107, 108, 109, 110, 111, 112,
  1523. 114, 115, 116, 117, 102, 104,  99, 126, 123, 125,  39, 121, 120, 124,  96, 113,
  1524. UNK, 101, UNK, UNK, UNK,  83,  73,  73,  74, UNK, UNK, UNK, 107, UNK, 117, UNK
  1525. };
  1526.  
  1527. CHAR yskcy[] = {  /* Short KOI to Latin/Cyrillic */
  1528.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1529.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1530.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1531.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1532.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1533.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1534. 206, 176, 177, 198, 180, 181, 196, 179, 197, 184, 185, 186, 187, 188, 189, 190,
  1535. 191, 207, 192, 193, 194, 195, 182, 178, 204, 203, 183, 200, 205, 201, 199, 127
  1536. };
  1537. #endif /* CYRILLIC */
  1538.  
  1539. #ifdef LATIN2
  1540.  
  1541. /* Latin-2 tables */
  1542.  
  1543. CHAR
  1544. yl252[] = {  /* Latin-2 to Code Page 852 */
  1545.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1546.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1547.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1548.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1549.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1550.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1551.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1552. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1553. 174, 175, 176, 177, 178, 179, 180, 185, 186, 187, 188, 191, 192, 193, 194, 195,
  1554. 196, 197, 200, 201, 202, 203, 204, 205, 206, 217, 218, 219, 220, 223, 240, 254,
  1555. 255, 164, 244, 157, 207, 149, 151, 245, 249, 230, 184, 155, 141, 170, 166, 189,
  1556. 248, 165, 242, 136, 239, 150, 152, 243, 247, 231, 173, 156, 171, 241, 167, 190,
  1557. 232, 181, 182, 198, 142, 145, 143, 128, 172, 144, 168, 211, 183, 214, 215, 210,
  1558. 209, 227, 213, 224, 226, 138, 153, 158, 252, 222, 233, 235, 154, 237, 221, 225,
  1559. 234, 160, 131, 199, 132, 146, 134, 135, 159, 130, 169, 137, 216, 161, 140, 212,
  1560. 208, 228, 229, 162, 147, 139, 148, 246, 253, 133, 163, 251, 129, 236, 238, 250
  1561. };
  1562.  
  1563. CHAR
  1564. y52l2[] = {  /* Code Page 852 to Latin-2 */
  1565.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1566.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1567.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1568.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1569.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1570.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1571.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1572. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1573. 199, 252, 233, 226, 228, 249, 230, 231, 179, 235, 213, 245, 238, 172, 196, 198,
  1574. 201, 197, 229, 244, 246, 165, 181, 166, 182, 214, 220, 171, 187, 163, 215, 232,
  1575. 225, 237, 243, 250, 161, 177, 174, 190, 202, 234, 173, 188, 200, 186, 128, 129,
  1576. 130, 131, 132, 133, 134, 193, 194, 204, 170, 135, 136, 137, 138, 175, 191, 139,
  1577. 140, 141, 142, 143, 144, 145, 195, 227, 146, 147, 148, 149, 150, 151, 152, 164,
  1578. 240, 208, 207, 203, 239, 210, 205, 206, 236, 153, 154, 155, 156, 222, 217, 157,
  1579. 211, 223, 212, 209, 241, 242, 169, 185, 192, 218, 224, 219, 253, 221, 254, 180,
  1580. 158, 189, 178, 183, 162, 167, 247, 184, 176, 168, 255, 251, 216, 248, 159, 160
  1581. };
  1582.  
  1583. CHAR
  1584. yl2l1[] = {  /* Latin-2 to Latin-1 */
  1585.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1586.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1587.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1588.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1589.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1590.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1591.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1592. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1593. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1594. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1595. 160, 'A', UNK, 'L', 164, 'L', 'S', 167, 168, 'S', 'S', 'T', 'Z', 173, 'Z', 'Z',
  1596. 176, 'a', UNK, 'l', 180, 'l', 's', UNK, 184, 's', 's', 't', 'z', UNK, 'z', 'z',
  1597. 'R', 193, 194, 'A', 196, 'L', 'C', 199, 'C', 201, 'E', 203, 'E', 205, 'I', 'D',
  1598. 208, 'N', 'N', 211, 212, 'O', 214, 215, 'R', 'U', 218, 'U', 220, 221, 'T', 's',
  1599. 'r', 225, 226, 'a', 228, 'l', 'c', 231, 'c', 233, 'e', 235, 'e', 237, 'i', 'd',
  1600. 240, 'n', 'n', 243, 244, 'o', 246, 247, 'r', 'u', 250, 'u', 252, 253, 't', '.'
  1601. };
  1602.  
  1603. CHAR
  1604. yl1l2[] = {  /* Latin-1 to Latin-2 */
  1605.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1606.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1607.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1608.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1609.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1610.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1611.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1612. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1613. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1614. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  1615. 160, 'A', UNK, 'L', 164, UNK, UNK, 167, 168, 'C', 'a', '<', '>', 173, 'R', UNK,
  1616. 176, UNK, UNK, UNK, 180, UNK, UNK, UNK, 184, UNK, 'o', '>', UNK, UNK, UNK, UNK,
  1617. 'A', 193, 194, 'A', 196, 'A', 'A', 199, 'E', 201, 'E', 203, 'I', 205, 'I', 'I',
  1618. 208, 'N', 'O', 211, 212, 'O', 214, 215, 'O', 'U', 218, 'U', 220, 221, UNK, 223,
  1619. 'a', 225, 226, 'a', 228, 'a', 'a', 231, 'e', 233, 'e', 235, 'i', 237, 'i', 'i',
  1620. 240, 'n', 'o', 243, 244, 'o', 246, 247, 'o', 'u', 250, 'u', 252, 253, UNK, 'y'
  1621. };
  1622.  
  1623. CHAR
  1624. yl2as[] = {  /* Latin-2 to ASCII */
  1625.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1626.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1627.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1628.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1629.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1630.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1631.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1632. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1633. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1634. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1635.  32, 'A', UNK, 'L', UNK, 'L', 'S', UNK,  34, 'S', 'S', 'T', 'Z', '-', 'Z', 'Z',
  1636. UNK, 'a', UNK, 'l',  39, 'l', 's', UNK,  44, 's', 's', 't', 'z', UNK, 'z', 'z',
  1637. 'R', 'A', 'A', 'A', 'A', 'L', 'C', 'C', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'D',
  1638. 'D', 'N', 'N', 'O', 'O', 'O', 'O', 'x', 'R', 'U', 'U', 'U', 'U', 'Y', 'T', 's',
  1639. 'r', 'a', 'a', 'a', 'a', 'l', 'c', 'c', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'd',
  1640. 'd', 'n', 'n', 'o', 'o', 'o', 'o', '/', 'r', 'u', 'u', 'u', 'u', 'y', 't', '.'
  1641. };
  1642. #endif /* LATIN2 */
  1643.  
  1644. #ifdef HEBREW
  1645. /*
  1646.   8-bit Tables providing invertible translation between Latin/Hebrew and CP862.
  1647. */
  1648. CHAR
  1649. y62lh[] = {  /* PC Code Page 862 to ISO 8859-8 Latin/Hebrew */
  1650.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1651.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1652.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1653.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1654.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1655.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1656.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1657. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1658. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  1659. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 162, 163, 165, 128, 129,
  1660. 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 172, 189, 188, 140, 171, 187,
  1661. 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156,
  1662. 157, 158, 159, 161, 164, 166, 167, 168, 169, 170, 173, 174, 175, 223, 179, 180,
  1663. 182, 184, 185, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
  1664. 203, 204, 205, 206, 207, 208, 181, 209, 210, 211, 212, 213, 214, 215, 216, 217,
  1665. 218, 177, 219, 220, 221, 222, 186, 251, 176, 183, 252, 253, 254, 178, 255, 160
  1666. };
  1667.  
  1668. CHAR
  1669. ylh62[] = {  /* ISO 8859-8 Latin/Hebrew to PC Code Page 862 */
  1670.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1671.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1672.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1673.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1674.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1675.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1676.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1677. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
  1678. 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 173, 176, 177, 178,
  1679. 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
  1680. 255, 195, 155, 156, 196, 157, 197, 198, 199, 200, 201, 174, 170, 202, 203, 204,
  1681. 248, 241, 253, 206, 207, 230, 208, 249, 209, 210, 246, 175, 172, 171, 211, 212,
  1682. 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,
  1683. 229, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 242, 243, 244, 245, 205,
  1684. 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
  1685. 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 247, 250, 251, 252, 254
  1686. };
  1687. /*
  1688.   7-bit table providing readable translation from DEC Hebrew-7 to CP862.
  1689. */
  1690. CHAR
  1691. yh762[] = {
  1692.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1693.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1694.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1695.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1696.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1697.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1698. UNK,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1699.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 123, 124, 125, 126, 127
  1700. };
  1701. /*
  1702.   8-bit table providing readable translation from CP862 to Hebrew-7.
  1703. */
  1704. CHAR
  1705. y62h7[] = {  /* PC Code Page 862 to Hebrew-7 */
  1706.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1707.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1708.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1709.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1710.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1711.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1712.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1713.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 123, 124, 125, 126, 127,
  1714.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1715. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, UNK,
  1716. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1717. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1718. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1719. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1720. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1721. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK
  1722. };
  1723. /*
  1724.   7-bit table providing readable translation from Hebrew-7 to ISO Latin/Hebrew.
  1725. */
  1726. CHAR
  1727. yh7lh[] = {
  1728.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1729.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1730.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1731.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1732.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1733.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1734. 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
  1735. 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 123, 124, 125, 126, 127
  1736. };
  1737. /*
  1738.   8-bit table providing readable translation from ISO Latin/Hebrew to Hebrew-7.
  1739. */
  1740. CHAR
  1741. ylhh7[] = {  /* Latin/Hebrew to Hebrew-7 */
  1742.   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  1743.  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
  1744.  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,
  1745.  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,
  1746.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1747.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
  1748.  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
  1749.  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90, 123, 124, 125, 126, 127,
  1750. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1751. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1752. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1753. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1754. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1755. UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK, UNK,
  1756.  96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
  1757. 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, UNK, UNK, UNK, UNK, UNK
  1758. };
  1759. #endif /* HEBREW */
  1760.  
  1761. /* Translation functions ... */
  1762.  
  1763. CHAR                /* The identity translation function.  */
  1764. #ifdef CK_ANSIC
  1765. ident(CHAR c)                /* (no longer used) */
  1766. #else
  1767. ident(c) CHAR c;
  1768. #endif /* CK_ANSIC */
  1769. { /* ident */
  1770.     return(c);                /* Instead, enter NULL in the  */
  1771. }                    /* table of functions to avoid */
  1772.                     /* needless function calls.    */
  1773. CHAR
  1774. #ifdef CK_ANSIC
  1775. xl1as(CHAR c) 
  1776. #else
  1777. xl1as(c) CHAR c; 
  1778. #endif /* CK_ANSIC */
  1779. { /* xl1as */             /* Latin-1 to US ASCII... */
  1780.     switch(langs[language].id) {
  1781.  
  1782.       case L_DUTCH:
  1783.     if (c == 255) {            /* Dutch umlaut-y */
  1784.         zmstuff('j');        /* becomes ij */
  1785.         return('i');
  1786.     } else return(yl1as[c]);    /* all others by the book */
  1787.  
  1788.       case L_GERMAN:
  1789.     switch (c) {            /* German, special rules. */
  1790.       case 196:            /* umlaut-A -> Ae */
  1791.         zmstuff('e');
  1792.         return('A');
  1793.       case 214:            /* umlaut-O -> Oe */
  1794.         zmstuff('e');
  1795.         return('O');
  1796.       case 220:            /* umlaut-U -> Ue */
  1797.         zmstuff('e');
  1798.         return('U');
  1799.       case 228:            /* umlaut-a -> ae */
  1800.         zmstuff('e');
  1801.         return('a');
  1802.       case 246:            /* umlaut-o -> oe */
  1803.         zmstuff('e');
  1804.         return('o');
  1805.       case 252:            /* umlaut-u -> ue */
  1806.         zmstuff('e');
  1807.         return('u');
  1808.       case 223:            /* ess-zet -> ss */
  1809.         zmstuff('s');
  1810.         return('s');
  1811.       default: return(yl1as[c]);    /* all others by the book */
  1812.     }
  1813.       case L_DANISH:
  1814.       case L_FINNISH:
  1815.       case L_NORWEGIAN:
  1816.       case L_SWEDISH:
  1817.     switch (c) {            /* Scandanavian languages. */
  1818.       case 196:            /* umlaut-A -> Ae */
  1819.           case 198:            /* AE ligature also -> Ae */
  1820.         zmstuff('e');
  1821.         return('A');
  1822.       case 214:            /* umlaut-O -> Oe */
  1823.       case 216:            /* O-slash -> Oe */
  1824.         zmstuff('e');
  1825.         return('O');
  1826.       case 220:            /* umlaut-U -> Ue */
  1827.       /*  return('Y'); replaced by "Ue" by popular demand. */
  1828.           /*  Y for Umlaut-U is only used in German names. */
  1829.         zmstuff('e');
  1830.         return('U');
  1831.       case 228:            /* umlaut-a -> ae */
  1832.           case 230:            /* ditto for ae ligature */
  1833.         zmstuff('e');
  1834.         return('a');
  1835.       case 246:            /* umlaut-o -> oe */
  1836.       case 248:            /* o-slash -> oe */
  1837.         zmstuff('e');
  1838.         return('o');
  1839.       case 252:            /* umlaut-u -> ue */
  1840.       /*  return('y'); replaced by "ue" by popular demand. */
  1841.         zmstuff('e');
  1842.         return('u');
  1843.       case 197:            /* A-ring -> Aa */
  1844.         zmstuff('a');
  1845.         return('A');
  1846.           case 229:            /* a-ring -> aa */
  1847.         zmstuff('a');
  1848.         return('a');
  1849.       default: return(yl1as[c]);    /* All others by the book */
  1850.     }
  1851.       case L_ICELANDIC:            /* Icelandic. */
  1852.     switch (c) {    
  1853.       case 198:            /* uppercase AE -> AE */
  1854.         zmstuff('e');
  1855.         return('A');
  1856.       case 208:            /* uppercase Eth -> D */
  1857.         return('D');
  1858.       case 214:            /* uppercase O-diaeresis -> Oe */
  1859.         zmstuff('e');
  1860.         return('O');
  1861.       case 222:            /* uppercase Thorn -> Th */
  1862.         zmstuff('h');
  1863.         return('T');
  1864.       case 230:            /* lowercase ae -> ae */
  1865.         zmstuff('e');
  1866.         return('a');
  1867.       case 240:            /* lowercase Eth -> d */
  1868.         return('d');
  1869.       case 246:            /* lowercase O-diaeresis -> oe */
  1870.         zmstuff('e');
  1871.         return('o');
  1872.       case 254:            /* lowercase Thorn -> th */
  1873.         zmstuff('h');
  1874.         return('t');
  1875.       default: return(yl1as[c]);    /* All others by the book */
  1876.     }
  1877.       default:
  1878.     return(yl1as[c]);        /* None of the above, by the table. */
  1879.     }
  1880. }
  1881.  
  1882. CHAR                    /* Latin-1 to German */
  1883. #ifdef CK_ANSIC
  1884. xl1ge(CHAR c) 
  1885. #else
  1886. xl1ge(c) CHAR c; 
  1887. #endif /* CK_ANSIC */
  1888. { /* xl1ge */
  1889.     return(yl1ge[c]);
  1890. }
  1891.  
  1892. CHAR                    /* German to Latin-1 */
  1893. #ifdef CK_ANSIC
  1894. xgel1(CHAR c) 
  1895. #else
  1896. xgel1(c) CHAR c; 
  1897. #endif /* CK_ANSIC */
  1898. { /* xgel1 */
  1899.     return(ygel1[c]);
  1900. }
  1901.  
  1902. CHAR
  1903. #ifdef CK_ANSIC
  1904. xgeas(CHAR c) 
  1905. #else
  1906. xgeas(c) CHAR c; 
  1907. #endif /* CK_ANSIC */
  1908. { /* xgeas */            /* German ISO 646 to ASCII */
  1909.     switch (c) {
  1910.       case 91:                /* umlaut-A -> Ae */
  1911.     zmstuff('e');
  1912.     return('A');
  1913.       case 92:                /* umlaut-O -> Oe */
  1914.     zmstuff('e');
  1915.     return('O');
  1916.       case 93:                /* umlaut-U -> Ue */
  1917.     zmstuff('e');
  1918.     return('U');
  1919.       case 123:                /* umlaut-a -> ae */
  1920.     zmstuff('e');
  1921.     return('a');
  1922.       case 124:                /* umlaut-o -> oe */
  1923.     zmstuff('e');
  1924.     return('o');
  1925.       case 125:                /* umlaut-u -> ue */
  1926.     zmstuff('e');
  1927.     return('u');
  1928.       case 126:                /* ess-zet -> ss */
  1929.     zmstuff('s');
  1930.     return('s');
  1931.       default:  return(c);        /* all others stay the same */
  1932.     }
  1933. }
  1934.  
  1935. CHAR
  1936. #ifdef CK_ANSIC
  1937. xduas(CHAR c) 
  1938. #else
  1939. xduas(c) CHAR c; 
  1940. #endif /* CK_ANSIC */
  1941. { /* xduas */            /* Dutch ISO 646 to US ASCII */
  1942.     switch (c) {
  1943.       case 64:  return(UNK);        /* 3/4 */
  1944.       case 91:                /* y-diaeresis */
  1945.     zmstuff('j');
  1946.     return('i');
  1947.       case 92:  return(UNK);        /* 1/2 */
  1948.       case 93:  return(124);        /* vertical bar */
  1949.       case 123: return(34);        /* diaeresis */
  1950.       case 124: return(UNK);        /* Florin */
  1951.       case 125: return(UNK);        /* 1/4 */
  1952.       case 126: return(39);        /* Apostrophe */
  1953.       default:  return(c);
  1954.     }
  1955. }
  1956.  
  1957. CHAR
  1958. #ifdef CK_ANSIC
  1959. xfias(CHAR c) 
  1960. #else
  1961. xfias(c) CHAR c; 
  1962. #endif /* CK_ANSIC */
  1963. { /* xfias */            /* Finnish ISO 646 to US ASCII */
  1964.     switch (c) {
  1965.       case 91:                /* A-diaeresis */
  1966.     zmstuff('e');
  1967.     return('A');
  1968.       case 92:                /* O-diaeresis */
  1969.     zmstuff('e');
  1970.     return('O');
  1971.       case 93:                /* A-ring */
  1972.     zmstuff('a');
  1973.     return('A');
  1974.       case 94:                /* U-diaeresis */
  1975.     /* return('Y'); */
  1976.     zmstuff('e');
  1977.     return('U');
  1978.       case 96:                /* e-acute */
  1979.     return('e');
  1980.       case 123:                /* a-diaeresis */
  1981.     zmstuff('e');
  1982.     return('a');
  1983.       case 124:                /* o-diaeresis */
  1984.     zmstuff('e');
  1985.     return('o');
  1986.       case 125:                /* a-ring */
  1987.     zmstuff('a');
  1988.     return('a');
  1989.       case 126:                /* u-diaeresis */
  1990.     /* return('y'); */
  1991.     zmstuff('e');
  1992.     return('U');
  1993.       default:
  1994.     return(c);
  1995.     }
  1996. }
  1997.  
  1998. CHAR
  1999. #ifdef CK_ANSIC
  2000. xfras(CHAR c) 
  2001. #else
  2002. xfras(c) CHAR c; 
  2003. #endif /* CK_ANSIC */
  2004. { /* xfras */            /* French ISO 646 to US ASCII */
  2005.     switch (c) {
  2006.       case 64:  return(97);        /* a grave */
  2007.       case 91:  return(UNK);        /* degree sign */
  2008.       case 92:  return(99);        /* c cedilla */
  2009.       case 93:  return(UNK);        /* paragraph sign */
  2010.       case 123: return(101);        /* e acute */
  2011.       case 124: return(117);        /* u grave */
  2012.       case 125: return(101);        /* e grave */
  2013.       case 126: return(34);        /* diaeresis */
  2014.       default:  return(c);
  2015.     }
  2016. }
  2017.  
  2018. CHAR
  2019. #ifdef CK_ANSIC
  2020. xfcas(CHAR c) 
  2021. #else
  2022. xfcas(c) CHAR c; 
  2023. #endif /* CK_ANSIC */
  2024. { /* xfcas */            /* French Canadian ISO 646 to ASCII */
  2025.     switch (c) {
  2026.       case 64:  return('a');        /* a grave */
  2027.       case 91:  return('a');        /* a circumflex */
  2028.       case 92:  return('c');        /* c cedilla */
  2029.       case 93:  return('e');        /* e circumflex */
  2030.       case 94:  return('i');        /* i circumflex */
  2031.       case 96:  return('o');        /* o circumflex */
  2032.       case 123: return('e');        /* e acute */
  2033.       case 124: return('u');        /* u grave */
  2034.       case 125: return('e');        /* e grave */
  2035.       case 126: return('u');        /* u circumflex */
  2036.       default:  return(c);
  2037.     }
  2038. }
  2039.  
  2040. CHAR
  2041. #ifdef CK_ANSIC
  2042. xitas(CHAR c) 
  2043. #else
  2044. xitas(c) CHAR c; 
  2045. #endif /* CK_ANSIC */
  2046. { /* xitas */            /* Italian ISO 646 to ASCII */
  2047.     switch (c) {
  2048.       case 91:  return(UNK);        /* degree */
  2049.       case 92:  return('c');        /* c cedilla */
  2050.       case 93:  return('e');        /* e acute */
  2051.       case 96:  return('u');        /* u grave */
  2052.       case 123: return('a');        /* a grave */
  2053.       case 124: return('o');        /* o grave */
  2054.       case 125: return('e');        /* e grave */
  2055.       case 126: return('i');        /* i grave */
  2056.       default:  return(c);
  2057.     }
  2058. }
  2059.  
  2060. CHAR
  2061. #ifdef CK_ANSIC
  2062. xneas(CHAR c) 
  2063. #else
  2064. xneas(c) CHAR c; 
  2065. #endif /* CK_ANSIC */
  2066. { /* xneas */            /* NeXT to ASCII */
  2067.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2068.     if (c == 234) {            /* handle OE digraph. */
  2069.         zmstuff('E');
  2070.         return('O');
  2071.     } else if (c == 250) {        /* Also lowercase oe. */
  2072.         zmstuff('e');
  2073.         return('o');
  2074.     }
  2075.     }
  2076.     c = xnel1(c);            /* Convert to Latin-1 */
  2077.     return(yl1as[c]);            /* Convert Latin-1 to ASCII */
  2078. }
  2079.  
  2080. CHAR
  2081. #ifdef CK_ANSIC
  2082. xnoas(CHAR c) 
  2083. #else
  2084. xnoas(c) CHAR c; 
  2085. #endif /* CK_ANSIC */
  2086. { /* xnoas */            /* Norge/Danish ISO 646 to ASCII */
  2087.     switch (c) {
  2088.       case 91:
  2089.     zmstuff('E');            /* AE digraph */
  2090.     return('A');
  2091.       case 92: return('O');        /* O slash */
  2092.       case 93:                /* A ring */
  2093.     zmstuff('a');
  2094.     return('A');
  2095.       case 123:                /* ae digraph */
  2096.     zmstuff('e');
  2097.     return('a');
  2098.       case 124: return('o');        /* o slash */
  2099.       case 125:                /* a ring */
  2100.     zmstuff('a');
  2101.     return('a');
  2102.       default:  return(c);
  2103.     }
  2104. }
  2105.  
  2106. CHAR
  2107. #ifdef CK_ANSIC
  2108. xpoas(CHAR c) 
  2109. #else
  2110. xpoas(c) CHAR c; 
  2111. #endif /* CK_ANSIC */
  2112. { /* xpoas */            /* Portuguese ISO 646 to ASCII */
  2113.     switch (c) {
  2114.       case 91:  return('A');        /* A tilde */
  2115.       case 92:  return('C');        /* C cedilla */
  2116.       case 93:  return('O');        /* O tilde */
  2117.       case 123: return('a');        /* a tilde */
  2118.       case 124: return('c');        /* c cedilla */
  2119.       case 125: return('o');        /* o tilde */
  2120.       default:  return(c);
  2121.     }
  2122. }
  2123.  
  2124. CHAR
  2125. #ifdef CK_ANSIC
  2126. xspas(CHAR c) 
  2127. #else
  2128. xspas(c) CHAR c; 
  2129. #endif /* CK_ANSIC */
  2130. { /* xspas */            /* Spanish ISO 646 to ASCII */
  2131.     switch (c) {
  2132.       case 91:  return(33);        /* Inverted exclamation */
  2133.       case 92:  return('N');        /* N tilde */
  2134.       case 93:  return(63);        /* Inverted question mark */
  2135.       case 123: return(UNK);        /* degree */
  2136.       case 124: return('n');        /* n tilde */
  2137.       case 125: return('c');        /* c cedilla */
  2138.       default:  return(c);
  2139.     }
  2140. }
  2141.  
  2142. CHAR
  2143. #ifdef CK_ANSIC
  2144. xswas(CHAR c) 
  2145. #else
  2146. xswas(c) CHAR c; 
  2147. #endif /* CK_ANSIC */
  2148. { /* xswas */            /* Swedish ISO 646 to ASCII */
  2149.     switch (c) {
  2150.       case 64:  return('E');        /* E acute */
  2151.       case 91:                /* A diaeresis */
  2152.     zmstuff('e');
  2153.     return('A');
  2154.       case 92:                /* O diaeresis */
  2155.     zmstuff('e');
  2156.     return('O');
  2157.       case 93:                /* A ring */
  2158.     zmstuff('a');
  2159.     return('A');
  2160.       case 94:                /* U diaeresis */
  2161.     /* return('Y'); */
  2162.     zmstuff('e');
  2163.     return('U');
  2164.       case 96:  return('e');        /* e acute */
  2165.       case 123:                /* a diaeresis */
  2166.     zmstuff('e');
  2167.     return('a');
  2168.       case 124:                /* o diaeresis */
  2169.     zmstuff('e');
  2170.     return('o');
  2171.       case 125:                /* a ring */
  2172.     zmstuff('a');
  2173.     return('a');
  2174.       case 126:                /* u diaeresis */
  2175.     /* return('y'); */
  2176.     zmstuff('e');
  2177.     return('u');
  2178.       default:  return(c);
  2179.     }
  2180. }
  2181.  
  2182. CHAR
  2183. #ifdef CK_ANSIC
  2184. xchas(CHAR c) 
  2185. #else
  2186. xchas(c) CHAR c; 
  2187. #endif /* CK_ANSIC */
  2188. { /* xchas */            /* Swiss ISO 646 to ASCII */
  2189.     switch (c) {
  2190.       case 35:  return('u');        /* u grave */
  2191.       case 64:  return('a');        /* a grave */
  2192.       case 91:  return('e');        /* e acute */
  2193.       case 92:  return('c');        /* c cedilla */
  2194.       case 93:  return('e');        /* e circumflex */
  2195.       case 94:  return('i');        /* i circumflex */
  2196.       case 95:  return('e');        /* e grave */
  2197.       case 96:  return('o');        /* o circumflex */
  2198.       case 123:                /* a diaeresis */
  2199.     zmstuff('e');
  2200.     return('a');
  2201.       case 124:                /* o diaeresis */
  2202.     zmstuff('e');
  2203.     return('o');
  2204.       case 125:                /* u diaeresis */
  2205.     zmstuff('e');
  2206.     return('u');
  2207.       case 126: return('u');        /* u circumflex */
  2208.       default:  return(c);
  2209.     }
  2210. }
  2211.  
  2212. CHAR
  2213. #ifdef CK_ANSIC
  2214. xhuas(CHAR c) 
  2215. #else
  2216. xhuas(c) CHAR c; 
  2217. #endif /* CK_ANSIC */
  2218. { /* xhuas */            /* Hungarian ISO 646 to ASCII */
  2219.     switch (c) {
  2220.       case 64:  return('A');        /* A acute */
  2221.       case 91:  return('E');        /* E acute */
  2222.       case 92:  return('O');        /* O diaeresis */
  2223.       case 93:  return('U');        /* U diaeresis */
  2224.       case 96:  return('a');        /* a acute */
  2225.       case 123: return('e');        /* e acute */
  2226.       case 124: return('o');        /* o acute */
  2227.       case 125: return('u');        /* u acute */
  2228.       case 126: return(34);        /* double acute accent */
  2229.       default:  return(c);
  2230.     }
  2231. }
  2232.  
  2233. CHAR
  2234. #ifdef CK_ANSIC
  2235. xdmas(CHAR c) 
  2236. #else
  2237. xdmas(c) CHAR c; 
  2238. #endif /* CK_ANSIC */
  2239. { /* xdmas */            /* DEC MCS to ASCII */
  2240.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2241.     if (c == 215) {            /* handle OE digraph. */
  2242.         zmstuff('E');
  2243.         return('O');
  2244.     } else if (c == 247) {        /* Also lowercase oe. */
  2245.         zmstuff('e');
  2246.         return('o');
  2247.     }
  2248.     }
  2249.     return(yl1as[c]);            /* Otherwise treat like Latin-1 */
  2250. }
  2251.  
  2252. CHAR
  2253. #ifdef CK_ANSIC
  2254. xdgas(CHAR c)
  2255. #else
  2256. xdgas(c) CHAR c;
  2257. #endif /* CK_ANSIC */
  2258. { /*  xdgas */            /* Data General to ASCII */
  2259.     switch(c) {
  2260.       case 180: return('f');        /* Florin */
  2261.       case 183: return('<');        /* Less-equal */
  2262.       case 184: return('>');        /* Greater-equal */
  2263.       case 186: return(96);        /* Grave accent */
  2264.       case 191: return('^');        /* Uparrow */
  2265.       case 215:
  2266.     if (langs[language].id == L_FRENCH) { /* OE digraph */
  2267.         zmstuff('E');
  2268.         return('O');
  2269.     } else return('O');
  2270.       case 247:
  2271.     if (langs[language].id == L_FRENCH) { /* oe digraph */
  2272.         zmstuff('e');
  2273.         return('o');
  2274.     } else return('o');
  2275.       case 175: case 179: case 220: case 222:
  2276.       case 223: case 254: case 255:
  2277.     return(UNK);
  2278.       default:                /* The rest, convert to Latin-1 */
  2279.     return(yl1as[ydgl1[c]]);    /* and from there to ASCII */
  2280.     }
  2281. }
  2282.  
  2283. CHAR
  2284. #ifdef CK_ANSIC
  2285. xukl1(CHAR c) 
  2286. #else
  2287. xukl1(c) CHAR c; 
  2288. #endif /* CK_ANSIC */
  2289. { /* xukl1 */            /* UK ASCII to Latin-1 */
  2290.     if (c == 35)
  2291.       return(163);
  2292.     else return(c);
  2293. }
  2294.  
  2295. CHAR
  2296. #ifdef CK_ANSIC
  2297. xl1uk(CHAR c) 
  2298. #else
  2299. xl1uk(c) CHAR c; 
  2300. #endif /* CK_ANSIC */
  2301. { /* xl1uk */            /* Latin-1 to UK ASCII */
  2302.     if (c == 163)
  2303.       return(35);
  2304.     else return(yl1as[c]);
  2305. }
  2306.  
  2307. CHAR                    /* Latin-1 to French ISO 646 */
  2308. #ifdef CK_ANSIC
  2309. xl1fr(CHAR c) 
  2310. #else
  2311. xl1fr(c) CHAR c; 
  2312. #endif /* CK_ANSIC */
  2313. { /* xl1fr */
  2314.     return(yl1fr[c]);
  2315. }
  2316.  
  2317.  
  2318. CHAR                    /* French ASCII to Latin-1 */
  2319. #ifdef CK_ANSIC
  2320. xfrl1(CHAR c) 
  2321. #else
  2322. xfrl1(c) CHAR c; 
  2323. #endif /* CK_ANSIC */
  2324. { /* xfrl1 */
  2325.     return(yfrl1[c]);
  2326. }
  2327.  
  2328. CHAR                    /* Latin-1 to Dutch ASCII */
  2329. #ifdef CK_ANSIC
  2330. xl1du(CHAR c) 
  2331. #else
  2332. xl1du(c) CHAR c; 
  2333. #endif /* CK_ANSIC */
  2334. { /* xl1du */
  2335.     return(yl1du[c]);
  2336. }
  2337.  
  2338. CHAR
  2339. #ifdef CK_ANSIC
  2340. xdul1(CHAR c) 
  2341. #else
  2342. xdul1(c) CHAR c; 
  2343. #endif /* CK_ANSIC */
  2344. { /* xdul1 */            /* Dutch ISO 646 to Latin-1 */
  2345.     return(ydul1[c]);
  2346. }
  2347.  
  2348. CHAR
  2349. #ifdef CK_ANSIC
  2350. xfil1(CHAR c) 
  2351. #else
  2352. xfil1(c) CHAR c; 
  2353. #endif /* CK_ANSIC */
  2354. { /* xfil1 */            /* Finnish ISO 646 to Latin-1 */
  2355.     return(yfil1[c]); 
  2356. }
  2357.  
  2358. CHAR
  2359. #ifdef CK_ANSIC
  2360. xl1fi(CHAR c) 
  2361. #else
  2362. xl1fi(c) CHAR c; 
  2363. #endif /* CK_ANSIC */
  2364. { /* xl1fi */            /* Latin-1 to Finnish ISO 646 */
  2365.     return(yl1fi[c]); 
  2366. }
  2367.  
  2368. CHAR
  2369. #ifdef CK_ANSIC
  2370. xfcl1(CHAR c) 
  2371. #else
  2372. xfcl1(c) CHAR c; 
  2373. #endif /* CK_ANSIC */
  2374. { /* xfcl1 */            /* French Canadian ISO646 to Latin-1 */
  2375.     return(yfcl1[c]); 
  2376. }
  2377.  
  2378. CHAR
  2379. #ifdef CK_ANSIC
  2380. xl1fc(CHAR c) 
  2381. #else
  2382. xl1fc(c) CHAR c; 
  2383. #endif /* CK_ANSIC */
  2384. { /* xl1fc */            /* Latin-1 to French Canadian ISO646 */
  2385.     return(yl1fc[c]); 
  2386. }
  2387.  
  2388. CHAR
  2389. #ifdef CK_ANSIC
  2390. xitl1(CHAR c) 
  2391. #else
  2392. xitl1(c) CHAR c; 
  2393. #endif /* CK_ANSIC */
  2394. { /* xitl1 */            /* Italian ISO 646 to Latin-1 */
  2395.     return(yitl1[c]); 
  2396. }
  2397.  
  2398. CHAR
  2399. #ifdef CK_ANSIC
  2400. xl1it(CHAR c) 
  2401. #else
  2402. xl1it(c) CHAR c; 
  2403. #endif /* CK_ANSIC */
  2404. { /* xl1it */            /* Latin-1 to Italian ISO 646 */
  2405.     return(yl1it[c]); 
  2406. }
  2407.  
  2408. CHAR
  2409. #ifdef CK_ANSIC
  2410. xnel1(CHAR c) 
  2411. #else
  2412. xnel1(c) CHAR c; 
  2413. #endif /* CK_ANSIC */
  2414. { /* xnel1 */         /* NeXT to Latin-1 */
  2415.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2416.     if (c == 234) {            /* handle OE digraph. */
  2417.         zmstuff('E');
  2418.         return('O');
  2419.     } else if (c == 250) {        /* Also lowercase oe. */
  2420.         zmstuff('e');
  2421.         return('o');
  2422.     }
  2423.     }
  2424.     return(ynel1[c]);
  2425. }
  2426.  
  2427. CHAR
  2428. #ifdef CK_ANSIC
  2429. xl1ne(CHAR c) 
  2430. #else
  2431. xl1ne(c) CHAR c; 
  2432. #endif /* CK_ANSIC */
  2433. { /* xl1ne */         /* Latin-1 to NeXT */
  2434.     return(yl1ne[c]);
  2435. }
  2436.  
  2437. CHAR
  2438. #ifdef CK_ANSIC
  2439. xnol1(CHAR c) 
  2440. #else
  2441. xnol1(c) CHAR c; 
  2442. #endif /* CK_ANSIC */
  2443. { /* xnol1 */         /* Norwegian and Danish ISO 646 to Latin-1 */
  2444.     return(ynol1[c]); 
  2445. }
  2446.  
  2447. CHAR
  2448. #ifdef CK_ANSIC
  2449. xl1no(CHAR c) 
  2450. #else
  2451. xl1no(c) CHAR c; 
  2452. #endif /* CK_ANSIC */
  2453. { /* xl1no */         /* Latin-1 to Norwegian and Danish ISO 646 */
  2454.     return(yl1no[c]); 
  2455. }
  2456.  
  2457. CHAR
  2458. #ifdef CK_ANSIC
  2459. xpol1(CHAR c) 
  2460. #else
  2461. xpol1(c) CHAR c; 
  2462. #endif /* CK_ANSIC */
  2463. { /* xpol1 */            /* Portuguese ISO 646 to Latin-1 */
  2464.     return(ypol1[c]); 
  2465. }
  2466.  
  2467. CHAR
  2468. #ifdef CK_ANSIC
  2469. xl1po(CHAR c) 
  2470. #else
  2471. xl1po(c) CHAR c; 
  2472. #endif /* CK_ANSIC */
  2473. { /* xl1po */            /* Latin-1 to Portuguese ISO 646 */
  2474.     return(yl1po[c]); 
  2475. }
  2476.  
  2477. CHAR
  2478. #ifdef CK_ANSIC
  2479. xspl1(CHAR c) 
  2480. #else
  2481. xspl1(c) CHAR c; 
  2482. #endif /* CK_ANSIC */
  2483. { /* xspl1 */            /* Spanish ISO 646 to Latin-1 */
  2484.     return(yspl1[c]); 
  2485. }
  2486.  
  2487. CHAR
  2488. #ifdef CK_ANSIC
  2489. xl1sp(CHAR c) 
  2490. #else
  2491. xl1sp(c) CHAR c; 
  2492. #endif /* CK_ANSIC */
  2493. { /* xl1sp */            /* Latin-1 to Spanish ISO 646 */
  2494.     return(yl1sp[c]); 
  2495. }
  2496.  
  2497. CHAR
  2498. #ifdef CK_ANSIC
  2499. xswl1(CHAR c) 
  2500. #else
  2501. xswl1(c) CHAR c; 
  2502. #endif /* CK_ANSIC */
  2503. { /* xswl1 */            /* Swedish ISO 646 to Latin-1 */
  2504.     return(yswl1[c]); 
  2505. }
  2506.  
  2507. CHAR
  2508. #ifdef CK_ANSIC
  2509. xl1sw(CHAR c) 
  2510. #else
  2511. xl1sw(c) CHAR c; 
  2512. #endif /* CK_ANSIC */
  2513. { /* xl1sw */            /* Latin-1 to Swedish ISO 646 */
  2514.     return(yl1sw[c]); 
  2515. }
  2516.  
  2517. CHAR
  2518. #ifdef CK_ANSIC
  2519. xchl1(CHAR c) 
  2520. #else
  2521. xchl1(c) CHAR c; 
  2522. #endif /* CK_ANSIC */
  2523. { /* xchl1 */            /* Swiss ISO 646 to Latin-1 */
  2524.     return(ychl1[c]); 
  2525. }
  2526.  
  2527. CHAR
  2528. #ifdef CK_ANSIC
  2529. xl1ch(CHAR c) 
  2530. #else
  2531. xl1ch(c) CHAR c; 
  2532. #endif /* CK_ANSIC */
  2533. { /* xl1ch */            /* Latin-1 to Swiss ISO 646 */
  2534.     return(yl1ch[c]); 
  2535. }
  2536.  
  2537. CHAR
  2538. #ifdef CK_ANSIC
  2539. xhul1(CHAR c) 
  2540. #else
  2541. xhul1(c) CHAR c; 
  2542. #endif /* CK_ANSIC */
  2543. { /* xhul1 */            /* Hungarian ISO 646 to Latin-1 */
  2544.     return(yhul1[c]);
  2545. }
  2546.  
  2547. CHAR
  2548. #ifdef CK_ANSIC
  2549. xl1hu(CHAR c) 
  2550. #else
  2551. xl1hu(c) CHAR c; 
  2552. #endif /* CK_ANSIC */
  2553. { /* xl1hu */            /* Latin-1 to Hungarian ISO 646 */
  2554.     return(yl1hu[c]);
  2555. }
  2556.  
  2557. CHAR
  2558. #ifdef CK_ANSIC
  2559. xl1dm(CHAR c) 
  2560. #else
  2561. xl1dm(c) CHAR c; 
  2562. #endif /* CK_ANSIC */
  2563. { /* xl1dm */ /* Latin-1 to DEC Multinational Character Set (MCS) */
  2564.     return(yl1dm[c]); 
  2565. }
  2566.  
  2567. CHAR
  2568. #ifdef CK_ANSIC
  2569. xl1dg(CHAR c) 
  2570. #else
  2571. xl1dg(c) CHAR c; 
  2572. #endif /* CK_ANSIC */
  2573. { /* xl1dg */ /* Latin-1 to DG International Character Set (MCS) */
  2574.     return(yl1dg[c]); 
  2575. }
  2576.  
  2577. CHAR
  2578. #ifdef CK_ANSIC
  2579. xdml1(CHAR c) 
  2580. #else
  2581. xdml1(c) CHAR c; 
  2582. #endif /* CK_ANSIC */
  2583. { /* xdml1 */ /* DEC Multinational Character Set (MCS) to Latin-1 */
  2584.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2585.     if (c == 215) {            /* handle OE digraph. */
  2586.         zmstuff('E');
  2587.         return('O');
  2588.     } else if (c == 247) {        /* Also lowercase oe. */
  2589.         zmstuff('e');
  2590.         return('o');
  2591.     }
  2592.     }
  2593.     return(ydml1[c]); 
  2594. }
  2595.  
  2596. CHAR
  2597. #ifdef CK_ANSIC
  2598. xdgl1(CHAR c) 
  2599. #else
  2600. xdgl1(c) CHAR c; 
  2601. #endif /* CK_ANSIC */
  2602. { /* xdgl1 */ /* DG International Character Set (MCS) to Latin-1 */
  2603.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2604.     if (c == 215) {            /* handle OE digraph. */
  2605.         zmstuff('E');
  2606.         return('O');
  2607.     } else if (c == 247) {        /* Also lowercase oe. */
  2608.         zmstuff('e');
  2609.         return('o');
  2610.     }
  2611.     }
  2612.     return(ydgl1[c]); 
  2613. }
  2614.  
  2615. /* Translation functions for receiving files and translating them into ASCII */
  2616.  
  2617. CHAR
  2618. #ifdef CK_ANSIC
  2619. zl1as(CHAR c) 
  2620. #else
  2621. zl1as(c) CHAR c; 
  2622. #endif /* CK_ANSIC */
  2623. { /* zl1as */
  2624.     switch(langs[language].id) {
  2625.  
  2626.       case L_DUTCH:
  2627.     if (c == 255) {            /* Dutch umlaut-y */
  2628.         zdstuff('j');        /* becomes ij */
  2629.         return('i');
  2630.     } else return(yl1as[c]);    /* all others by the book */
  2631.  
  2632.       case L_GERMAN:
  2633.     switch (c) {            /* German, special rules. */
  2634.       case 196:            /* umlaut-A -> Ae */
  2635.         zdstuff('e');
  2636.         return('A');
  2637.       case 214:            /* umlaut-O -> Oe */
  2638.         zdstuff('e');
  2639.         return('O');
  2640.       case 220:            /* umlaut-U -> Ue */
  2641.         zdstuff('e');
  2642.         return('U');
  2643.       case 228:            /* umlaut-a -> ae */
  2644.         zdstuff('e');
  2645.         return('a');
  2646.       case 246:            /* umlaut-o -> oe */
  2647.         zdstuff('e');
  2648.         return('o');
  2649.       case 252:            /* umlaut-u -> ue */
  2650.         zdstuff('e');
  2651.         return('u');
  2652.       case 223:            /* ess-zet -> ss */
  2653.         zdstuff('s');
  2654.         return('s');
  2655.       default: return(yl1as[c]);    /* all others by the book */
  2656.     }
  2657.       case L_DANISH:
  2658.       case L_FINNISH:
  2659.       case L_NORWEGIAN:
  2660.       case L_SWEDISH:
  2661.     switch (c) {            /* Scandanavian languages. */
  2662.       case 196:            /* umlaut-A -> Ae */
  2663.         zdstuff('e');
  2664.         return('A');
  2665.       case 214:            /* umlaut-O -> Oe */
  2666.       case 216:            /* O-slash -> Oe */
  2667.         zdstuff('e');
  2668.         return('O');
  2669.       case 220:            /* umlaut-U -> Y */
  2670.         /* return('Y'); */
  2671.         zdstuff('e');
  2672.         return('U');
  2673.       case 228:            /* umlaut-a -> ae */
  2674.         zdstuff('e');
  2675.         return('a');
  2676.       case 246:            /* umlaut-o -> oe */
  2677.       case 248:            /* o-slash -> oe */
  2678.         zdstuff('e');
  2679.         return('o');
  2680.       case 252:            /* umlaut-u -> y */
  2681.         /* return('y'); */
  2682.         zdstuff('e');
  2683.         return('u');
  2684.       case 197:            /* A-ring -> Aa */
  2685.         zdstuff('a');
  2686.         return('A');
  2687.           case 229:            /* a-ring -> aa */
  2688.         zdstuff('a');
  2689.         return('a');
  2690.       default: return(yl1as[c]);    /* All others by the book */
  2691.     }
  2692.       default:
  2693.     return(yl1as[c]);        /* Not German, by the table. */
  2694.     }
  2695. }
  2696.  
  2697. CHAR                    /* IBM CP437 to Latin-1 */
  2698. #ifdef CK_ANSIC
  2699. x43l1(CHAR c) 
  2700. #else
  2701. x43l1(c) CHAR c; 
  2702. #endif /* CK_ANSIC */
  2703. { /* x43l1 */
  2704.     return(y43l1[c]);
  2705. }
  2706.  
  2707. CHAR                    /* IBM CP850 to Latin-1 */
  2708. #ifdef CK_ANSIC
  2709. x85l1(CHAR c) 
  2710. #else
  2711. x85l1(c) CHAR c; 
  2712. #endif /* CK_ANSIC */
  2713. { /* x85l1 */
  2714.     return(y85l1[c]);
  2715. }
  2716.  
  2717. CHAR                    /* Latin-1 to IBM CP437 */
  2718. #ifdef CK_ANSIC
  2719. xl143(CHAR c) 
  2720. #else
  2721. xl143(c) CHAR c; 
  2722. #endif /* CK_ANSIC */
  2723. { /* xl143 */
  2724.     return(yl143[c]);
  2725. }
  2726.  
  2727. CHAR                    /* Latin-1 to CP850 */
  2728. #ifdef CK_ANSIC
  2729. xl185(CHAR c) 
  2730. #else
  2731. xl185(c) CHAR c; 
  2732. #endif /* CK_ANSIC */
  2733. { /* xl185 */
  2734.     return(yl185[c]);
  2735. }
  2736.  
  2737. CHAR
  2738. #ifdef CK_ANSIC
  2739. x43as(CHAR c) 
  2740. #else
  2741. x43as(c) CHAR c; 
  2742. #endif /* CK_ANSIC */
  2743. { /* x43as */                /* CP437 to ASCII */
  2744.     c = y43l1[c];            /* Translate to Latin-1 */
  2745.     return(xl143(c));            /* and from Latin-1 to ASCII. */
  2746. }
  2747.  
  2748. CHAR
  2749. #ifdef CK_ANSIC
  2750. x85as(CHAR c) 
  2751. #else
  2752. x85as(c) CHAR c; 
  2753. #endif /* CK_ANSIC */
  2754. { /* x85as */                /* CP850 to ASCII */
  2755.     c = y85l1[c];            /* Translate to Latin-1 */
  2756.     return(xl1as(c));            /* and from Latin-1 to ASCII. */
  2757. }
  2758.  
  2759. CHAR                    /* Macintosh Latin to Latin-1 */
  2760. #ifdef CK_ANSIC
  2761. xaql1(CHAR c) 
  2762. #else
  2763. xaql1(c) CHAR c; 
  2764. #endif /* CK_ANSIC */
  2765. { /* xaql1 */
  2766.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2767.     if (c == 206) {            /* handle OE digraph. */
  2768.         zmstuff('E');
  2769.         return('O');
  2770.     } else if (c == 207) {        /* Also lowercase oe. */
  2771.         zmstuff('e');
  2772.         return('o');
  2773.     }
  2774.     }
  2775.     return(yaql1[c]);
  2776. }
  2777.  
  2778. CHAR                    /* Macintosh Latin to ASCII */
  2779. #ifdef CK_ANSIC
  2780. xaqas(CHAR c) 
  2781. #else
  2782. xaqas(c) CHAR c; 
  2783. #endif /* CK_ANSIC */
  2784. { /* xaqas */
  2785.     if (langs[language].id == L_FRENCH) { /* If SET LANGUAGE FRENCH */
  2786.     if (c == 206) {            /* handle OE digraph. */
  2787.         zmstuff('E');
  2788.         return('O');
  2789.     } else if (c == 207) {        /* Also lowercase oe. */
  2790.         zmstuff('e');
  2791.         return('o');
  2792.     }
  2793.     }
  2794.     c = yaql1[c];            /* Translate to Latin-1 */
  2795.     return(xl1as(c));            /* then to ASCII. */
  2796. }
  2797.  
  2798. CHAR                    /* Latin-1 to Macintosh Latin */
  2799. #ifdef CK_ANSIC
  2800. xl1aq(CHAR c) 
  2801. #else
  2802. xl1aq(c) CHAR c; 
  2803. #endif /* CK_ANSIC */
  2804. { /* xl1aq */
  2805.     return(yl1aq[c]);
  2806. }
  2807.  
  2808. #ifdef LATIN2
  2809.  
  2810. /* Translation functions for Latin Alphabet 2 */
  2811.  
  2812. CHAR                    /* Latin-2 to Latin-1 */
  2813. #ifdef CK_ANSIC
  2814. xl2l1(CHAR c) 
  2815. #else
  2816. xl2l1(c) CHAR c; 
  2817. #endif /* CK_ANSIC */
  2818. { /* xll2l1 */
  2819.     return(yl2l1[c]);
  2820. }
  2821.  
  2822. CHAR                    /* Latin-1 to Latin-2 */
  2823. #ifdef CK_ANSIC
  2824. xl1l2(CHAR c) 
  2825. #else
  2826. xl1l2(c) CHAR c; 
  2827. #endif /* CK_ANSIC */
  2828. { /* xll1l2 */
  2829.     return(yl1l2[c]);
  2830. }
  2831.  
  2832. CHAR                    /* Latin-2 to ASCII */
  2833. #ifdef CK_ANSIC
  2834. xl2as(CHAR c) 
  2835. #else
  2836. xl2as(c) CHAR c; 
  2837. #endif /* CK_ANSIC */
  2838. { /* xll2as */
  2839.     return(yl2as[c]);
  2840. }
  2841.  
  2842. CHAR                    /* Latin-2 to CP852 */
  2843. #ifdef CK_ANSIC
  2844. xl252(CHAR c) 
  2845. #else
  2846. xl252(c) CHAR c; 
  2847. #endif /* CK_ANSIC */
  2848. { /* xll252 */
  2849.     return(yl252[c]);
  2850. }
  2851.  
  2852. CHAR                    /* CP852 to Latin-2 */
  2853. #ifdef CK_ANSIC
  2854. x52l2(CHAR c) 
  2855. #else
  2856. x52l2(c) CHAR c; 
  2857. #endif /* CK_ANSIC */
  2858. { /* x52l2 */
  2859.     return(y52l2[c]);
  2860. }
  2861.  
  2862. CHAR                    /* CP852 to ASCII */
  2863. #ifdef CK_ANSIC
  2864. x52as(CHAR c) 
  2865. #else
  2866. x52as(c) CHAR c; 
  2867. #endif /* CK_ANSIC */
  2868. { /* xl52as */
  2869.     return(yl2as[y52l2[c]]);        /* CP852 -> Latin-2 -> ASCII */
  2870. }
  2871.  
  2872. CHAR                    /* CP852 to Latin-1 */
  2873. #ifdef CK_ANSIC
  2874. x52l1(CHAR c) 
  2875. #else
  2876. x52l1(c) CHAR c; 
  2877. #endif /* CK_ANSIC */
  2878. { /* xl52l1 */
  2879.     return(yl2l1[y52l2[c]]);        /* CP852 -> Latin-2 -> Latin-1 */
  2880. }
  2881.  
  2882. CHAR                    /* Latin-1 to CP852 */
  2883. #ifdef CK_ANSIC
  2884. xl152(CHAR c) 
  2885. #else
  2886. xl152(c) CHAR c; 
  2887. #endif /* CK_ANSIC */
  2888. { /* xll152 */
  2889.     return(yl252[yl1l2[c]]);        /* Latin-1 -> Latin-2 -> CP852 */
  2890. }
  2891.  
  2892. CHAR                    /* Latin-2 to NeXT */
  2893. #ifdef CK_ANSIC
  2894. xl2ne(CHAR c) 
  2895. #else
  2896. xl2ne(c) CHAR c; 
  2897. #endif /* CK_ANSIC */
  2898. { /* xll2ne */
  2899.     switch(c) {
  2900.       case 162: return(198);        /* Breve */
  2901.       case 163: return(232);        /* L with stroke */
  2902.       case 178: return(206);        /* Ogonek */
  2903.       case 179: return(248);        /* l with stroke */
  2904.       case 183: return(207);        /* Caron */
  2905.       case 189: return(205);        /* Double acute */
  2906.       case 208: return(144);        /* D stroke = Eth */
  2907.       case 240: return(230);        /* d stroke = eth */
  2908.       case 255: return(199);        /* Dot above */
  2909.       default:  return(yl1ne[yl2l1[c]]);
  2910.     }
  2911. }
  2912.  
  2913. CHAR                    /* Latin-2 to CP437 */
  2914. #ifdef CK_ANSIC
  2915. xl243(CHAR c) 
  2916. #else
  2917. xl243(c) CHAR c; 
  2918. #endif /* CK_ANSIC */
  2919. { /* xll243 */
  2920.     return(yl1l2[y43l1[c]]);
  2921. }
  2922.  
  2923. CHAR                    /* Latin-2 to CP850 */
  2924. #ifdef CK_ANSIC
  2925. xl285(CHAR c) 
  2926. #else
  2927. xl285(c) CHAR c; 
  2928. #endif /* CK_ANSIC */
  2929. { /* xll285 */
  2930.     return(yl1l2[y85l1[c]]);
  2931. }
  2932.  
  2933. CHAR                    /* Latin-2 to Apple */
  2934. #ifdef CK_ANSIC
  2935. xl2aq(CHAR c) 
  2936. #else
  2937. xl2aq(c) CHAR c; 
  2938. #endif /* CK_ANSIC */
  2939. { /* xl2aq */
  2940.     return(yl1aq[yl2l1[c]]);        /* Could do more... */
  2941. }
  2942.  
  2943. CHAR                    /* Latin-2 to DGI */
  2944. #ifdef CK_ANSIC
  2945. xl2dg(CHAR c) 
  2946. #else
  2947. xl2dg(c) CHAR c; 
  2948. #endif /* CK_ANSIC */
  2949. { /* xll2dg */
  2950.     return(yl1l2[ydgl1[c]]);
  2951. }
  2952.  
  2953. CHAR                    /* Latin-2 to Short KOI */
  2954. #ifdef CK_ANSIC
  2955. xl2sk(CHAR c) 
  2956. #else
  2957. xl2sk(c) CHAR c; 
  2958. #endif /* CK_ANSIC */
  2959. { /* xll2sk */
  2960.     return(islower(c) ? toupper(c) : c);
  2961. }
  2962.  
  2963. CHAR                    /* NeXT to Latin-2 */
  2964. #ifdef CK_ANSIC
  2965. xnel2(CHAR c) 
  2966. #else
  2967. xnel2(c) CHAR c; 
  2968. #endif /* CK_ANSIC */
  2969. { /* xnel2 */
  2970.     switch (c) {
  2971.       case 144: return(208);        /* D stroke = Eth */
  2972.       case 198: return(162);        /* Breve */
  2973.       case 199: return(255);        /* Dot above */
  2974.       case 205: return(189);        /* Double acute */
  2975.       case 206: return(178);        /* Ogonek */
  2976.       case 207: return(183);        /* Caron */
  2977.       case 230: return(240);        /* d stroke = eth */
  2978.       case 232: return(163);        /* L with stroke */
  2979.       case 248: return(179);        /* l with stroke */
  2980.       default:  return(yl1l2[ynel1[c]]); /* Others, go thru Latin-1 */
  2981.     }
  2982. }
  2983.  
  2984. CHAR                    /* CP437 to Latin-2 */
  2985. #ifdef CK_ANSIC
  2986. x43l2(CHAR c) 
  2987. #else
  2988. x43l2(c) CHAR c; 
  2989. #endif /* CK_ANSIC */
  2990. { /* xl43l2 */
  2991.     return(yl1l2[y43l1[c]]);
  2992. }
  2993.  
  2994. CHAR                    /* CP850 to Latin-2 */
  2995. #ifdef CK_ANSIC
  2996. x85l2(CHAR c) 
  2997. #else
  2998. x85l2(c) CHAR c; 
  2999. #endif /* CK_ANSIC */
  3000. { /* xl85l2 */
  3001.     return(yl1l2[y85l1[c]]);
  3002. }
  3003.  
  3004. CHAR                    /* Apple to Latin-2 */
  3005. #ifdef CK_ANSIC
  3006. xaql2(CHAR c) 
  3007. #else
  3008. xaql2(c) CHAR c; 
  3009. #endif /* CK_ANSIC */
  3010. { /* xlaql2 */
  3011.     switch (c) {
  3012.       case 249: return(162);        /* Breve accent */
  3013.       case 250: return(255);        /* Dot accent */
  3014.       case 253: return(189);        /* Double acute */
  3015.       default: return(yl1l2[yaql1[c]]);
  3016.     }
  3017. }
  3018.  
  3019. CHAR                    /* DGI to Latin-2 */
  3020. #ifdef CK_ANSIC
  3021. xdgl2(CHAR c) 
  3022. #else
  3023. xdgl2(c) CHAR c; 
  3024. #endif /* CK_ANSIC */
  3025. { /* xldgl2 */
  3026.     return(yl1l2[ydgl1[c]]);        /* (for now) */
  3027. }
  3028.  
  3029. CHAR                    /* Short KOI to Latin-2 */
  3030. #ifdef CK_ANSIC
  3031. xskl2(CHAR c) 
  3032. #else
  3033. xskl2(c) CHAR c; 
  3034. #endif /* CK_ANSIC */
  3035. { /* xlskl2 */
  3036.     return(islower(c) ? toupper(c) : c);
  3037. }
  3038.  
  3039. CHAR                    /* Latin-2 to German */
  3040. #ifdef CK_ANSIC
  3041. xl2ge(CHAR c) 
  3042. #else
  3043. xl2ge(c) CHAR c; 
  3044. #endif /* CK_ANSIC */
  3045. { /* xll2ge */
  3046.     switch(c) {
  3047.       case 167: return(64);        /* Paragraph sign */
  3048.       case 196: return(91);        /* A-diaeresis */
  3049.       case 214: return(92);        /* O-diaeresis */
  3050.       case 220: return(93);        /* U-diaeresis */
  3051.       case 223: return(126);        /* double-s */
  3052.       case 228: return(123);        /* a-diaeresis */
  3053.       case 246: return(124);        /* o-diaeresis */
  3054.       case 252: return(125);        /* u-diaeresis */
  3055.       default:  return(yl2as[c]);    /* Others */
  3056.     }
  3057. }
  3058.  
  3059. CHAR                    /* German to Latin-2 */
  3060. #ifdef CK_ANSIC
  3061. xgel2(CHAR c) 
  3062. #else
  3063. xgel2(c) CHAR c; 
  3064. #endif /* CK_ANSIC */
  3065. { /* xlgel2 */
  3066.     switch(c) {
  3067.       case 64:  return(167);        /* Paragraph sign */
  3068.       case 91:  return(196);        /* A-diaeresis */
  3069.       case 92:  return(214);        /* O-diaeresis */
  3070.       case 93:  return(220);        /* U-diaeresis */
  3071.       case 123: return(228);        /* a-diaeresis */
  3072.       case 126: return(223);        /* double-s */
  3073.       case 124: return(246);        /* o-diaeresis */
  3074.       case 125: return(252);        /* u-diaeresis */
  3075.       default:  return(c);        /* Others */
  3076.     }
  3077. }
  3078.  
  3079. CHAR                    /* Latin-2 to Hungarian */
  3080. #ifdef CK_ANSIC
  3081. xl2hu(CHAR c) 
  3082. #else
  3083. xl2hu(c) CHAR c; 
  3084. #endif /* CK_ANSIC */
  3085. { /* xll2hu */
  3086.     switch(c) {
  3087.       case 164: return(36);        /* Currency symbol */
  3088.       case 189: return(126);        /* Double acute accent */
  3089.       case 193: return(64);        /* A-acute */
  3090.       case 201: return(91);        /* E-acute */
  3091.       case 214: return(92);        /* O-diaeresis */
  3092.       case 220: return(93);        /* U-diaeresis */
  3093.       case 225: return(96);        /* a-acute */
  3094.       case 233: return(123);        /* e-acute */
  3095.       case 246: return(124);        /* o-diaeresis */
  3096.       case 252: return(125);        /* u-diaeresis */
  3097.       default:  return(yl2as[c]);    /* Others */
  3098.     }
  3099. }
  3100.  
  3101. CHAR                    /* Hungarian to Latin-2 */
  3102. #ifdef CK_ANSIC
  3103. xhul2(CHAR c) 
  3104. #else
  3105. xhul2(c) CHAR c; 
  3106. #endif /* CK_ANSIC */
  3107. { /* xlhul2 */
  3108.     switch(c) {
  3109.       case 36:  return(164);        /* Currency symbol */
  3110.       case 64:  return(193);        /* A-acute */
  3111.       case 91:  return(201);        /* E-acute */
  3112.       case 92:  return(214);        /* O-diaeresis */
  3113.       case 93:  return(220);        /* U-diaeresis */
  3114.       case 96:  return(225);        /* a-acute */
  3115.       case 123: return(233);        /* e-acute */
  3116.       case 124: return(246);        /* o-diaeresis */
  3117.       case 125: return(252);        /* u-diaeresis */
  3118.       case 126: return(189);        /* Double acute accent */
  3119.       default:  return(c);        /* Others */
  3120.     }
  3121. }
  3122. #else /* NOLATIN2 */
  3123. #define xl2l1 NULL
  3124. #define xl1l2 NULL
  3125. #define xl2as NULL
  3126. #define xl252 NULL
  3127. #define x52l2 NULL
  3128. #define x52as NULL
  3129. #define x52l1 NULL
  3130. #define xl152 NULL
  3131. #define xl2ne NULL
  3132. #define xl243 NULL
  3133. #define xl285 NULL
  3134. #define xl2aq NULL
  3135. #define xl2dg NULL
  3136. #define xl2sk NULL
  3137. #define xnel2 NULL
  3138. #define x43l2 NULL
  3139. #define x85l2 NULL
  3140. #define xaql2 NULL
  3141. #define xdgl2 NULL
  3142. #define xskl2 NULL
  3143. #define xl2ge NULL
  3144. #define xgel2 NULL
  3145. #define xl2hu NULL
  3146. #define xhul2 NULL
  3147. #endif /* LATIN2 */
  3148.  
  3149. #ifdef CYRILLIC
  3150. /* Translation functions for Cyrillic character sets */
  3151.  
  3152. CHAR                    /* Latin/Cyrillic to */
  3153. #ifdef CK_ANSIC
  3154. xlcac(CHAR c) 
  3155. #else
  3156. xlcac(c) CHAR c; 
  3157. #endif /* CK_ANSIC */
  3158. { /* xlcac */            /* Microsoft Code Page 866 */
  3159.     return(ylcac[c]);
  3160. }
  3161.  
  3162. CHAR                    /* Latin/Cyrillic to Old KOI-8 */
  3163. #ifdef CK_ANSIC
  3164. xlck8(CHAR c) 
  3165. #else
  3166. xlck8(c) CHAR c; 
  3167. #endif /* CK_ANSIC */
  3168. { /* xlck8 */
  3169.     return(ylck8[c]);
  3170. }
  3171.  
  3172. CHAR
  3173. #ifdef CK_ANSIC
  3174. xlcsk(CHAR c) 
  3175. #else
  3176. xlcsk(c) CHAR c; 
  3177. #endif /* CK_ANSIC */
  3178. { /* xlcsk */            /* Latin/Cyrillic to Short KOI */
  3179.     return(ylcsk[c]);
  3180. }
  3181.  
  3182. CHAR
  3183. #ifdef CK_ANSIC
  3184. xlcas(CHAR c) 
  3185. #else
  3186. xlcas(c) CHAR c; 
  3187. #endif /* CK_ANSIC */
  3188. { /* xlcas */            /* Latin/Cyrillic to ASCII */
  3189.     if (langs[language].id == L_RUSSIAN)
  3190.       return(ylcsk[c]);
  3191.     else
  3192.       return((c > 127) ? '?' : c);
  3193. }
  3194.  
  3195. CHAR                    /* CP866 */
  3196. #ifdef CK_ANSIC
  3197. xaclc(CHAR c) 
  3198. #else
  3199. xaclc(c) CHAR c; 
  3200. #endif /* CK_ANSIC */
  3201. { /* xaclc */            /* to Latin/Cyrillic */
  3202.     return(yaclc[c]);
  3203. }
  3204.  
  3205. CHAR                    /* Old KOI-8 to Latin/Cyrillic */
  3206. #ifdef CK_ANSIC
  3207. xk8lc(CHAR c) 
  3208. #else
  3209. xk8lc(c) CHAR c; 
  3210. #endif /* CK_ANSIC */
  3211. { /* xk8lc */
  3212.     return(yk8lc[c]);
  3213. }
  3214.  
  3215. CHAR
  3216. #ifdef CK_ANSIC
  3217. xskcy(CHAR c) 
  3218. #else
  3219. xskcy(c) CHAR c; 
  3220. #endif /* CK_ANSIC */
  3221. { /* xskcy */            /* Short KOI to Latin/Cyrillic */
  3222.     return(yskcy[c & 0x7f]);
  3223. }
  3224.  
  3225. CHAR
  3226. #ifdef CK_ANSIC
  3227. xascy(CHAR c) 
  3228. #else
  3229. xascy(c) CHAR c; 
  3230. #endif /* CK_ANSIC */
  3231. { /* xascy */            /* ASCII to Latin/Cyrillic */
  3232.     if (langs[language].id == L_RUSSIAN) { /* If LANGUAGE == RUSSIAN  */
  3233.     return(yskcy[c & 0x7f]);    /* treat ASCII as Short KOI */
  3234.     } else return((c > 127) ? '?' : c);
  3235. }
  3236.  
  3237. CHAR
  3238. #ifdef CK_ANSIC
  3239. xacas(CHAR c) 
  3240. #else
  3241. xacas(c) CHAR c; 
  3242. #endif /* CK_ANSIC */
  3243. { /* xacas */            /* CP866 to ASCII */
  3244.     if (langs[language].id == L_RUSSIAN) {
  3245.     c = yaclc[c];            /* First to Latin/Cyrillic */
  3246.     return(ylcsk[c]);        /* Then to Short KOI */
  3247.     } else return((c > 127) ? '?' : c);
  3248. }
  3249.  
  3250. CHAR
  3251. #ifdef CK_ANSIC
  3252. xskas(CHAR c) 
  3253. #else
  3254. xskas(c) CHAR c; 
  3255. #endif /* CK_ANSIC */
  3256. { /* xskas */            /* Short KOI to ASCII */
  3257.     return((c > 95) ? '?' : c);
  3258. }
  3259.  
  3260. CHAR
  3261. #ifdef CK_ANSIC
  3262. xk8as(CHAR c) 
  3263. #else
  3264. xk8as(c) CHAR c; 
  3265. #endif /* CK_ANSIC */
  3266. { /* xk8as */            /* Old KOI-8 Cyrillic to ASCII */
  3267.     if (langs[language].id == L_RUSSIAN) {
  3268.     c = yk8lc[c];            /* First to Latin/Cyrillic */
  3269.     return(ylcsk[c]);        /* Then to Short KOI */
  3270.     } else return((c > 127) ? '?' : c);
  3271. }
  3272.  
  3273. CHAR
  3274. #ifdef CK_ANSIC
  3275. xassk(CHAR c) 
  3276. #else
  3277. xassk(c) CHAR c; 
  3278. #endif /* CK_ANSIC */
  3279. { /* xassk */            /* ASCII to Short KOI */
  3280.     c &= 0x77;                /* Force it to be ASCII */
  3281.     return((c > 95) ? (c - 32) : c);    /* Fold columns 6-7 to 4-5 */
  3282. }
  3283.  
  3284. CHAR
  3285. #ifdef CK_ANSIC
  3286. xl1sk(CHAR c) 
  3287. #else
  3288. xl1sk(c) CHAR c; 
  3289. #endif /* CK_ANSIC */
  3290. { /* xl1sk */            /* Latin-1 to Short KOI */
  3291.     c = zl1as(c);            /* Convert to ASCII */
  3292.     return(c = xassk(c));        /* Convert ASCII to Short KOI */
  3293. }
  3294.  
  3295. CHAR
  3296. #ifdef CK_ANSIC
  3297. xaslc(CHAR c) 
  3298. #else
  3299. xaslc(c) CHAR c; 
  3300. #endif /* CK_ANSIC */
  3301. { /* xaslc */            /* ASCII to Latin/Cyrillic */
  3302.     if (langs[language].id == L_RUSSIAN)
  3303.       return(yskcy[c & 0x7f]);
  3304.     else return(c & 0x7f);
  3305. }
  3306.  
  3307. CHAR
  3308. #ifdef CK_ANSIC
  3309. xasac(CHAR c) 
  3310. #else
  3311. xasac(c) CHAR c; 
  3312. #endif /* CK_ANSIC */
  3313. { /* xasac */            /* ASCII to CP866 */
  3314.     if (langs[language].id == L_RUSSIAN) { /* Use Short KOI */
  3315.     c = xskcy(c);            /* Translate to Latin/Cyrillic */
  3316.     return(ylcac[c]);        /* Then to CP866 */
  3317.     } else return(c & 0x7f);
  3318. }
  3319.  
  3320. CHAR
  3321. #ifdef CK_ANSIC
  3322. xask8(CHAR c) 
  3323. #else
  3324. xask8(c) CHAR c; 
  3325. #endif /* CK_ANSIC */
  3326. { /* xask8 */            /* ASCII to KOI-8 */
  3327.     if (langs[language].id == L_RUSSIAN) { /* Use Short KOI */
  3328.     c = xskcy(c);            /* Translate to Latin/Cyrillic */
  3329.     return(ylck8[c]);        /* Then to KOI-8 */
  3330.     } else return(c & 0x7f);
  3331. }
  3332. #else
  3333. #define xacas NULL
  3334. #define xaclc NULL
  3335. #define xasac NULL
  3336. #define xascy NULL
  3337. #define xask8 NULL
  3338. #define xaslc NULL
  3339. #define xassk NULL
  3340. #define xk8as NULL
  3341. #define xk8lc NULL
  3342. #define xl1sk NULL
  3343. #define xlcac NULL
  3344. #define xlcas NULL
  3345. #define xlck8 NULL
  3346. #define xlcsk NULL
  3347. #define xskas NULL
  3348. #define xskcy NULL
  3349. #endif /* CYRILLIC */
  3350.  
  3351. /* Translation functions for Hebrew character sets */
  3352.  
  3353. #ifdef HEBREW
  3354.  
  3355. CHAR
  3356. #ifdef CK_ANSIC
  3357. xash7(CHAR c) 
  3358. #else
  3359. xash7(c) CHAR c; 
  3360. #endif /* CK_ANSIC */
  3361. { /* xash7 */            /* ASCII to Hebrew-7 */
  3362.     if (c == 96) return('?');
  3363.     if (c > 96 && c < 123) return(c - 32);
  3364.     else return(c);
  3365. }
  3366.  
  3367. CHAR
  3368. #ifdef CK_ANSIC
  3369. xl1h7(CHAR c) 
  3370. #else
  3371. xl1h7(c) CHAR c; 
  3372. #endif /* CK_ANSIC */
  3373. { /* xl1h7 */            /* Latin-1 to Hebrew-7 */
  3374.     return(xash7(xl1as(c)));
  3375. }
  3376.  
  3377. CHAR
  3378. #ifdef CK_ANSIC
  3379. xl1lh(CHAR c) 
  3380. #else
  3381. xl1lh(c) CHAR c; 
  3382. #endif /* CK_ANSIC */
  3383. { /* xl1lh */            /* Latin-1 to Latin/Hebrew */
  3384.     switch(c) {
  3385.       case 170: return('a');        /* Feminine ordinal */
  3386.       case 186: return('o');        /* Masculine ordinal */
  3387.       case 215: return(170);        /* Times */
  3388.       case 247: return(186);        /* Divide */
  3389.       default:  return( (c > 190) ? xl1as(c) : c );
  3390.     }
  3391. }
  3392.  
  3393. CHAR
  3394. #ifdef CK_ANSIC
  3395. xl2h7(CHAR c) 
  3396. #else
  3397. xl2h7(c) CHAR c; 
  3398. #endif /* CK_ANSIC */
  3399. { /* xl2h7 */            /* Latin-2 to Hebrew-7 */
  3400.     return(xash7(xl2as(c)));
  3401. }
  3402.  
  3403. CHAR
  3404. #ifdef CK_ANSIC
  3405. xlch7(CHAR c) 
  3406. #else
  3407. xlch7(c) CHAR c; 
  3408. #endif /* CK_ANSIC */
  3409. { /* xlch7 */            /* Latin/Cyrillic to Hebrew-7 */
  3410.     return(xash7(xlcas(c)));
  3411. }
  3412.  
  3413. CHAR
  3414. #ifdef CK_ANSIC
  3415. xlhas(CHAR c) 
  3416. #else
  3417. xlhas(c) CHAR c; 
  3418. #endif /* CK_ANSIC */
  3419. { /* xlhas */            /* Latin/Hebrew to ASCII */
  3420.     return( (c > 127) ? '?' : c );
  3421. }
  3422.  
  3423. CHAR
  3424. #ifdef CK_ANSIC
  3425. xlhl1(CHAR c) 
  3426. #else
  3427. xlhl1(c) CHAR c; 
  3428. #endif /* CK_ANSIC */
  3429. { /* xlhl1 */            /* Latin/Hebrew to Latin-1 */
  3430.     switch (c) {
  3431.       case 170: return(215);
  3432.       case 186: return(247);
  3433.       default: return( (c > 190) ? '?' : c );
  3434.     }
  3435. }
  3436.  
  3437. CHAR
  3438. #ifdef CK_ANSIC
  3439. xlh62(CHAR c) 
  3440. #else
  3441. xlh62(c) CHAR c; 
  3442. #endif /* CK_ANSIC */
  3443. { /* xlh62 */            /* Latin/Hebrew to CP862 */
  3444.     return(ylh62[c]);
  3445. }
  3446.  
  3447. CHAR
  3448. #ifdef CK_ANSIC
  3449. xl162(CHAR c) 
  3450. #else
  3451. xl162(c) CHAR c; 
  3452. #endif /* CK_ANSIC */
  3453. { /* xl162 */            /* Latin-1 to CP862 */
  3454.     return(xlh62(xl1lh(c)));    /* Via Latin/Hebrew */
  3455. }
  3456.  
  3457. CHAR
  3458. #ifdef CK_ANSIC
  3459. xlhh7(CHAR c) 
  3460. #else
  3461. xlhh7(c) CHAR c; 
  3462. #endif /* CK_ANSIC */
  3463. { /* xlhh7 */            /* Latin/Hebrew to Hebrew-7 */
  3464.     return(ylhh7[c]);
  3465. }
  3466.  
  3467. CHAR
  3468. #ifdef CK_ANSIC
  3469. xh7as(CHAR c) 
  3470. #else
  3471. xh7as(c) CHAR c; 
  3472. #endif /* CK_ANSIC */
  3473. { /* xh7as */            /* Hebrew-7 to ASCII */
  3474.     return( (c > 95 && c < 123) ? '?' : c );
  3475. }
  3476.  
  3477. CHAR
  3478. #ifdef CK_ANSIC
  3479. x62lh(CHAR c) 
  3480. #else
  3481. x62lh(c) CHAR c; 
  3482. #endif /* CK_ANSIC */
  3483. { /* x62lh */            /* CP862 to Latin/Hebrew */
  3484.     return(y62lh[c]);
  3485. }
  3486.  
  3487. CHAR
  3488. #ifdef CK_ANSIC
  3489. x62as(CHAR c) 
  3490. #else
  3491. x62as(c) CHAR c; 
  3492. #endif /* CK_ANSIC */
  3493. { /* x62as */            /* CP862 to ASCII */
  3494.     return( xlhas(x62lh(c)) );
  3495. }
  3496.  
  3497. CHAR
  3498. #ifdef CK_ANSIC
  3499. x62l1(CHAR c) 
  3500. #else
  3501. x62l1(c) CHAR c; 
  3502. #endif /* CK_ANSIC */
  3503. { /* x62l1 */            /* CP862 to Latin-1 */
  3504.     return( xlhl1(x62lh(c)) );
  3505. }
  3506.  
  3507. CHAR
  3508. #ifdef CK_ANSIC
  3509. xh7lh(CHAR c) 
  3510. #else
  3511. xh7lh(c) CHAR c; 
  3512. #endif /* CK_ANSIC */
  3513. { /* xh7lh */            /* Hebrew-7 to Latin/Hebrew */
  3514.     return(yh7lh[c]);
  3515. }
  3516.  
  3517. #else
  3518.  
  3519. #define xash7 NULL
  3520. #define xl1h7 NULL
  3521. #define xl2h7 NULL
  3522. #define xlch7 NULL
  3523. #define xl1lh NULL
  3524. #define xlhas NULL
  3525. #define xlhl1 NULL
  3526. #define xl162 NULL
  3527. #define xlhh7 NULL
  3528. #define xlh62 NULL
  3529. #define xh7as NULL
  3530. #define x62as NULL
  3531. #define x62l1 NULL
  3532. #define xh7lh NULL
  3533. #define x62lh NULL
  3534.  
  3535. #endif /* HEBREW */
  3536.  
  3537. /* Translation functions for Japanese Kanji character sets */
  3538.  
  3539. #ifdef KANJI
  3540. /*
  3541.   Translate Kanji Transfer Character Set (EUC) to local file character set,
  3542.   contributed by Dr. Hirofumi Fujii, Japan High Energy Research Laboratory
  3543.   (KEK), Tokyo, Japan.
  3544.  
  3545.   a is a byte to be translated, which may be a single-byte character,
  3546.   the Katakana prefix, the first byte of a two-byte Kanji character, or the
  3547.   second byte of 2-byte Kanji character.
  3548.  
  3549.   fn is the output function.
  3550.  
  3551.   Returns 0 on success, -1 on failure.
  3552. */
  3553.  
  3554. _PROTOTYP(static int jpnxas, (int, int[]) );
  3555. _PROTOTYP(static int jpnxkt, (int, int[]) );
  3556. _PROTOTYP(static int jpnxkn, (int[], int[]) );
  3557.  
  3558. static int jpncnt;       /* byte count for Japanese */
  3559. static int jpnlst;       /* last status (for JIS7) */
  3560.  
  3561. static int
  3562. jpnxas(a, obuf) int a; int obuf[]; { /* Translate ASCII to local file code */
  3563.     int r;
  3564.  
  3565.     r = 0;
  3566.     if (fcharset == FC_JIS7) {
  3567.     switch (jpnlst) {
  3568.       case 1:
  3569.         obuf[0] = 0x0f;
  3570.         obuf[1] = a;
  3571.         r = 2;
  3572.         break;
  3573.       case 2:
  3574.         obuf[0] = 0x1b;
  3575.         obuf[1] = 0x28;
  3576.         obuf[2] = 0x4a;
  3577.         obuf[3] = a;
  3578.         r = 4;
  3579.         break;
  3580.       default:
  3581.         obuf[0] = a;
  3582.         r = 1;
  3583.         break;
  3584.     }
  3585.     } else {
  3586.     obuf[0] = a;
  3587.     r = 1;
  3588.     }
  3589.     return(r);
  3590. }
  3591.  
  3592. static int
  3593. jpnxkt(a, obuf) int a; int obuf[]; { 
  3594. /* Translate JIS X 201 Katakana to local code */
  3595.  
  3596.     int r;
  3597.   
  3598.     r = 0;
  3599.     if (fcharset == FC_JIS7) {
  3600.     switch (jpnlst) {
  3601.       case 2:                /* from Kanji */
  3602.         obuf[r++] = 0x1b;
  3603.         obuf[r++] = 0x28;
  3604.         obuf[r++] = 0x4a;
  3605.       case 0:                /* from Roman */
  3606.         obuf[r++] = 0x0e;
  3607.       default:
  3608.         obuf[r++] = (a & 0x7f);
  3609.       break;
  3610.     }
  3611.     } else {
  3612.     if (fcharset == FC_JEUC)
  3613.       obuf[r++] = 0x8e;
  3614.     obuf[r++] = (a | 0x80);
  3615.     }
  3616.     return(r);
  3617. }
  3618.  
  3619. static int
  3620. jpnxkn(ibuf, obuf) int ibuf[], obuf[]; {
  3621.     /* Translate JIS X 0208 Kanji to local code */
  3622.     int c1, c2;
  3623.     int r;
  3624.  
  3625.     c1 = ibuf[0] & 0x7f;
  3626.     c2 = ibuf[1] & 0x7f;
  3627.  
  3628.     if (fcharset == FC_SHJIS) {
  3629.     if (c1 & 1)
  3630.       c2 += 0x1f;
  3631.     else
  3632.       c2 += 0x7d;
  3633.  
  3634.         if (c2 >= 0x7f) c2++;
  3635.  
  3636.         c1 = ((c1 - 0x21) >> 1) + 0x81;
  3637.         if (c1 > 0x9f) c1 += 0x40;
  3638.  
  3639.         obuf[0] = c1;
  3640.         obuf[1] = c2;
  3641.         r = 2;
  3642.     } else if (fcharset == FC_JIS7) {
  3643.         r = 0;
  3644.         switch (jpnlst) {
  3645.         case 1:
  3646.         obuf[r++] = 0x0f; /* From Katakana */
  3647.         case 0:
  3648.         obuf[r++] = 0x1b;
  3649.         obuf[r++] = 0x24;
  3650.         obuf[r++] = 0x42;
  3651.       default:
  3652.         obuf[r++] = c1;
  3653.         obuf[r++] = c2;
  3654.         break;
  3655.     }
  3656.     } else {
  3657.         obuf[0] = (c1 | 0x80);
  3658.         obuf[1] = (c2 | 0x80);
  3659.         r = 2;
  3660.     }
  3661.     return(r);
  3662. }
  3663.  
  3664. int
  3665. xkanjf() {
  3666. /* Initialize parameters for xkanji */
  3667. /* This function should be called when F/X-packet is received */
  3668.     jpncnt = jpnlst = 0;
  3669.     return(0);
  3670. }
  3671.  
  3672. int
  3673. #ifdef CK_ANSIC
  3674. xkanjz( int (*fn)(char) )
  3675. #else
  3676. xkanjz( fn ) int (*fn)();
  3677. #endif /* CK_ANSIC */
  3678. { /* xkanjz */
  3679. /*
  3680.   Terminate xkanji
  3681.   This function must be called when Z-packet is received
  3682.   (before closing the file).
  3683. */
  3684.     static int obuf[6];
  3685.     int r, i, c;
  3686.   
  3687.     if (fcharset == FC_JIS7) {
  3688.         c = 'A';            /* Dummy Roman character */
  3689.         r = jpnxas(c, obuf) - 1;    /* -1 removes Dummy character */
  3690.         if (r > 0) {
  3691.         for (i = 0; i < r; i++)
  3692.           if ( ((*fn)((char) obuf[i])) < 0 )
  3693.         return( -1 );
  3694.     }
  3695.     }
  3696.     return( 0 );
  3697. }
  3698.  
  3699. int
  3700. #ifdef CK_ANSIC
  3701. xkanji(int a, int (*fn)(char))
  3702. #else
  3703. xkanji(a, fn) int a; int (*fn)();
  3704. #endif /* CK_ANSIC */
  3705. { /* xkanji */
  3706.     static int xbuf[2];
  3707.     static int obuf[8];
  3708.  
  3709.     int i, r;
  3710.     int c7;
  3711.     int state;
  3712.  
  3713.     r = 0;
  3714.     if (jpncnt == 0) {
  3715.     /* 1st byte */
  3716.     if ( (a & 0x80) == 0 ) {
  3717.         /* 8th bit is 0, i.e., single-byte code */
  3718.         r = jpnxas(a, obuf);
  3719.         state = 0;
  3720.     } else {
  3721.         /* 8th bit is 1, check the range */
  3722.         c7 = a & 0x7f;
  3723.         if ( ((c7 > 0x20) && (c7 < 0x7f)) || (c7 == 0x0e) ) {
  3724.             /* double byte code */
  3725.             xbuf[jpncnt++] = a;
  3726.         } else {
  3727.             /* single byte code */
  3728.             r = jpnxas(a, obuf);
  3729.             state = 0;
  3730.         }
  3731.     }
  3732.     } else {
  3733.     /* not the 1st byte */
  3734.     xbuf[jpncnt++] = a;
  3735.     if (xbuf[0] == 0x8e) {
  3736.         r = jpnxkt( xbuf[1], obuf );
  3737.         state = 1;
  3738.     } else {
  3739.         r = jpnxkn(xbuf, obuf);
  3740.         state = 2;
  3741.     }
  3742.     }
  3743.     if (r > 0) {
  3744.         for (i = 0; i < r; i++ )
  3745.       if ( ((*fn)((char) obuf[i])) < 0 )
  3746.         return( -1 );
  3747.         jpnlst = state;
  3748.         jpncnt = 0;
  3749.     }
  3750.     return( 0 );
  3751. }
  3752.  
  3753. /*
  3754.   Function for translating from Japanese file character set
  3755.   to Japanese EUC transfer character set.
  3756.   Returns a pointer to a string containing 0, 1, or 2 bytes.
  3757. */
  3758.  
  3759. /* zkanji */
  3760. static int jpnstz;            /* status for JIS-7 */
  3761. static int jpnpnd;            /* number of pending bytes */
  3762. static int jpnpnt;            /* pending buffer index */
  3763. static int jpnpbf[8];            /* pending buffer */
  3764.  
  3765. int
  3766. zkanjf() {                /* Initialize */
  3767.     jpnstz = jpnpnd = jpnpnt = 0;
  3768.     return(0);
  3769. }
  3770.  
  3771. int
  3772. zkanjz() {
  3773.     return( 0 );
  3774. }
  3775.  
  3776. int
  3777. #ifdef CK_ANSIC
  3778. zkanji( int (*fn)(void) )
  3779. #else
  3780. zkanji( fn ) int (*fn)();
  3781. #endif /* CK_ANSIC */
  3782. { /* zkanji */
  3783.     /* Read Japanese local code and translate to Japanese EUC */
  3784.     int a;
  3785.     int sc[3];
  3786.     
  3787.     /* No pending characters */
  3788.     if (fcharset == FC_SHJIS) {        /* Translating from Shift-JIS */
  3789.         if (jpnpnd) {
  3790.             jpnpnd--;
  3791.             return( jpnpbf[jpnpnt++] );
  3792.         }
  3793.         
  3794.         a = (*fn)();
  3795.     jpnpnd = jpnpnt = 0;
  3796.     if (((a >= 0x81) && (a <= 0x9f)) ||
  3797.         ((a >= 0xe0) && (a <= 0xfc))) { /* 2-byte Kanji code */
  3798.         sc[0] = a;
  3799.         if ((sc[1] = (*fn)()) < 0)    /* Get second byte */
  3800.           return( sc[1] );
  3801.         if (sc[0] <= 0x9f)
  3802.           sc[0] -= 0x71;
  3803.         else
  3804.           sc[0] -= 0xb1;
  3805.         sc[0] = sc[0] * 2 + 1;
  3806.         if (sc[1] > 0x7f)
  3807.           sc[1]--;
  3808.         if (sc[1] >= 0x9e) {
  3809.             sc[1] -= 0x7d;
  3810.             sc[0]++;
  3811.         } else {
  3812.             sc[1] -= 0x1f;
  3813.         }
  3814.         a = (sc[0] | 0x80);
  3815.         jpnpbf[0] = (sc[1] | 0x80);
  3816.         jpnpnd = 1;
  3817.         jpnpnt = 0;
  3818.     } else if ((a >= 0xa1) && (a <= 0xdf)) { /* Katakana */
  3819.         jpnpbf[0] = a;
  3820.         jpnpnd = 1;
  3821.         jpnpnt = 0;
  3822.         a = 0x8e;
  3823.     }
  3824.     return(a);
  3825.     } else if (fcharset == FC_JIS7 ) {    /* 7-bit JIS X 0208 */
  3826.         if (jpnpnd) {
  3827.             a = jpnpbf[jpnpnt++];
  3828.         jpnpnd--;
  3829.             return(a);
  3830.         }
  3831.         jpnpnt = 0;
  3832.         if ((a = (*fn)()) < 0)
  3833.       return(a);
  3834.         while (jpnpnd == 0) {
  3835.             if ((a > 0x20) && (a < 0x7f)) {
  3836.                 switch (jpnstz) {
  3837.           case 1:
  3838.             jpnpbf[jpnpnd++] = 0x80; /* Katakana */
  3839.             jpnpbf[jpnpnd++] = (a | 0x80);
  3840.             break;
  3841.           case 2:
  3842.             jpnpbf[jpnpnd++] = (a | 0x80); /* Kanji */
  3843.             if ((a = (*fn)()) < 0)
  3844.               return(a);
  3845.             jpnpbf[jpnpnd++] = (a | 0x80);
  3846.             break;
  3847.           default:
  3848.             jpnpbf[jpnpnd++] = a; /* Single byte */
  3849.             break;
  3850.                 }
  3851.             } else if (a == 0x0e) {
  3852.                 jpnstz = 1;
  3853.                 if ((a = (*fn)()) < 0)
  3854.           return(a);
  3855.             } else if (a == 0x0f) {
  3856.                 jpnstz = 0;
  3857.                 if ((a = (*fn)()) < 0)
  3858.           return(a);
  3859.             } else if (a == 0x1b) {
  3860.                 jpnpbf[jpnpnd++] = a;    /* Escape */
  3861.                 if ((a = (*fn)()) < 0)
  3862.           return(a);
  3863.                 jpnpbf[jpnpnd++] = a;
  3864.                 if (a == '$') {
  3865.                     if ((a = (*fn)()) < 0)
  3866.               return(a);
  3867.                     jpnpbf[jpnpnd++] = a;
  3868.                     if ((a == '@') || (a == 'B')) {
  3869.                         jpnstz = 2;
  3870.             jpnpnt = jpnpnd = 0;
  3871.                         if ((a = (*fn)()) < 0)
  3872.               return(a);
  3873.                     }
  3874.                 } else if (a == '(') {
  3875.                     if ((a = (*fn)()) < 0)
  3876.               return( a );
  3877.                     jpnpbf[jpnpnd++] = a;
  3878.                     if ((a == 'B') || (a == 'J')) {
  3879.                         jpnstz = 0;
  3880.             jpnpnt = jpnpnd = 0;
  3881.                         if ((a = (*fn)()) < 0)
  3882.               return(a);
  3883.                     }
  3884.                 } else if (a == 0x1b) {
  3885.                     jpnpnt = jpnpnd = 0;
  3886.                     if ((a = (*fn)()) < 0)
  3887.               return(a);
  3888.                 }
  3889.             } else {
  3890.                 jpnpbf[jpnpnd++] = a;
  3891.             }
  3892.         }
  3893.         jpnpnt = 0;
  3894.         a = jpnpbf[jpnpnt++];
  3895.     jpnpnd--;
  3896.         return(a);
  3897.     } else {
  3898.         a = (*fn)();
  3899.         return(a);
  3900.     }
  3901. }
  3902. #endif /* KANJI */
  3903.  
  3904. /*  TABLES OF TRANSLATION FUNCTIONS */
  3905.  
  3906. /*
  3907.   First, the table of translation functions for RECEIVING files.
  3908.   That is, *from* the TRANSFER character set *to* the FILE character set,
  3909.   an array of pointers to functions.  The first index is the
  3910.   transfer syntax character set number, the second index is the file 
  3911.   character set number.
  3912.  
  3913.   These arrays must be fully populated, even if (as is the case with
  3914.   Kanji character sets), all the entries are NULL.  Otherwise, 
  3915.   subscript calculations will be wrong and we'll use the wrong functions.
  3916. */
  3917.  
  3918. #ifdef CK_ANSIC
  3919. CHAR (*xlr[MAXTCSETS+1][MAXFCSETS+1])(CHAR) = 
  3920. #else
  3921. CHAR (*xlr[MAXTCSETS+1][MAXFCSETS+1])() = 
  3922. #endif /* CK_ANSIC */
  3923. {
  3924.     NULL,            /* 0,0 transparent to us ascii */
  3925.     NULL,            /* 0,1 transparent to uk ascii */
  3926.     NULL,            /* 0,2 transparent to dutch nrc */
  3927.     NULL,            /* 0,3 transparent to finnish nrc */
  3928.     NULL,            /* 0,4 transparent to french nrc */
  3929.     NULL,            /* 0,5 transparent to fr-canadian nrc */
  3930.     NULL,            /* 0,6 transparent to german nrc */
  3931.     NULL,            /* 0,7 transparent to hungarian nrc */
  3932.     NULL,            /* 0,8 transparent to italian nrc */
  3933.     NULL,            /* 0,9 transparent to norge/danish nrc */
  3934.     NULL,            /* 0,10 transparent to portuguese nrc */
  3935.     NULL,            /* 0,11 transparent to spanish nrc */
  3936.     NULL,            /* 0,12 transparent to swedish nrc */
  3937.     NULL,            /* 0,13 transparent to swiss nrc */
  3938.     NULL,            /* 0,14 transparent to latin-1 */
  3939.     NULL,            /* 0,15 transparent to latin-2 */
  3940.     NULL,            /* 0,16 transparent to DEC MCS */
  3941.     NULL,            /* 0,17 transparent to NeXT */
  3942.     NULL,            /* 0,18 transparent to CP437 */
  3943.     NULL,            /* 0,19 transparent to CP850 */
  3944.     NULL,            /* 0,20 transparent to CP852 */
  3945.     NULL,            /* 0,21 transparent to Macintosh Latin */
  3946.     NULL,            /* 0,22 transparent to DGI */
  3947.     NULL,            /* 0,23 transparent to Latin/Cyrillic */
  3948.     NULL,                       /* 0,24 transparent to CP866 */
  3949.     NULL,            /* 0,25 transparent to Short KOI-7 */
  3950.     NULL,                       /* 0,26 transparent to Old KOI-8 Cyrillic */
  3951.     NULL,            /* 0,27 transparent to JIS-7 */
  3952.     NULL,            /* 0,28 transparent to Shift-JIS */
  3953.     NULL,            /* 0,29 transparent to J-EUC */
  3954.     NULL,            /* 0,30 transparent to DEC Kanji */
  3955.     NULL,            /* 0,31 transparent to Hebrew-7 */
  3956.     NULL,            /* 0,32 transparent to Latin/Hebrew */
  3957.     NULL,            /* 0,33 transparent to CP862 Hebrew */
  3958.     NULL,            /* 1,0 ascii to us ascii */
  3959.     NULL,            /* 1,1 ascii to uk ascii */
  3960.     NULL,            /* 1,2 ascii to dutch nrc */
  3961.     NULL,            /* 1,3 ascii to finnish nrc */
  3962.     NULL,            /* 1,4 ascii to french nrc */
  3963.     NULL,            /* 1,5 ascii to fr-canadian nrc */
  3964.     NULL,            /* 1,6 ascii to german nrc */
  3965.     NULL,            /* 1,7 ascii to hungarian nrc */
  3966.     NULL,            /* 1,8 ascii to italian nrc */
  3967.     NULL,            /* 1,9 ascii to norge/danish nrc */
  3968.     NULL,            /* 1,10 ascii to portuguese nrc */
  3969.     NULL,            /* 1,11 ascii to spanish nrc */
  3970.     NULL,            /* 1,12 ascii to swedish nrc */
  3971.     NULL,            /* 1,13 ascii to swiss nrc */
  3972.     NULL,            /* 1,14 ascii to latin-1 */
  3973.     NULL,            /* 1,15 ascii to latin-2 */
  3974.     NULL,            /* 1,16 ascii to DEC MCS */
  3975.     NULL,            /* 1,17 ascii to NeXT */
  3976.     NULL,            /* 1,18 ascii to CP437 */
  3977.     NULL,            /* 1,19 ascii to CP850 */
  3978.     NULL,            /* 1,20 ascii to CP852 */
  3979.     NULL,            /* 1,21 ascii to Macintosh Latin */
  3980.     NULL,            /* 1,22 ascii to DGI */
  3981.     xaslc,                      /* 1,23 ascii to Latin/Cyrillic */
  3982.     xasac,                      /* 1,24 ascii to CP866 */
  3983.     xassk,                      /* 1,25 ascii to Short KOI */
  3984.     xask8,                      /* 1,26 ascii to Old KOI-8 Cyrillic */
  3985.     NULL,            /* 1,27 ascii to JIS-7 */
  3986.     NULL,            /* 1,28 ascii to Shift-JIS */
  3987.     NULL,            /* 1,29 ascii to J-EUC */
  3988.     NULL,            /* 1,30 ascii to DEC Kanji */
  3989.     xash7,            /* 1,31 ascii to Hebrew-7 */
  3990.     NULL,            /* 1,32 ascii to Latin/Hebrew */
  3991.     NULL,            /* 1,33 ascii to CP862 Hebrew */
  3992.     zl1as,            /* 2,0 latin-1 to us ascii */
  3993.     xl1uk,            /* 2,1 latin-1 to uk ascii */
  3994.     xl1du,            /* 2,2 latin-1 to dutch nrc */
  3995.     xl1fi,            /* 2,3 latin-1 to finnish nrc */
  3996.     xl1fr,            /* 2,4 latin-1 to french nrc */
  3997.     xl1fc,            /* 2,5 latin-1 to fr-canadian nrc */
  3998.     xl1ge,            /* 2,6 latin-1 to german nrc */
  3999.     xl1it,            /* 2,7 latin-1 to italian nrc */
  4000.     xl1hu,            /* 2,8 latin-1 to hungarian nrc */
  4001.     xl1no,            /* 2,9 latin-1 to norge/danish nrc */
  4002.     xl1po,            /* 2,10 latin-1 to portuguese nrc */
  4003.     xl1sp,            /* 2,11 latin-1 to spanish nrc */
  4004.     xl1sw,            /* 2,12 latin-1 to swedish nrc */
  4005.     xl1ch,            /* 2,13 latin-1 to swiss nrc */
  4006.     NULL,            /* 2,14 latin-1 to latin-1 */
  4007.     xl1l2,            /* 2,15 latin-1 to latin-2 */
  4008.     xl1dm,            /* 2,16 latin-1 to DEC MCS */
  4009.     xl1ne,            /* 2,17 latin-1 to NeXT */
  4010.     xl143,            /* 2,18 latin-1 to CP437 */
  4011.     xl185,            /* 2,19 latin-1 to CP850 */
  4012.     xl152,            /* 2,20 latin-1 to CP852 */
  4013.     xl1aq,            /* 2,21 latin-1 to Macintosh Latin */
  4014.     xl1dg,            /* 2,22 latin-1 to DGI */
  4015.     zl1as,            /* 2,23 latin-1 to Latin/Cyrillic */
  4016.     zl1as,                      /* 2,24 latin-1 to CP866 */
  4017.     xl1sk,                      /* 2,25 latin-1 to Short KOI */
  4018.     zl1as,                   /* 2,26 latin-1 to Old KOI-8 Cyrillic */
  4019.     NULL,            /* 2,27 latin-1 to JIS-7 */
  4020.     NULL,            /* 2,28 latin-1 to Shift-JIS */
  4021.     NULL,            /* 2,29 latin-1 to J-EUC */
  4022.     NULL,            /* 2,30 latin-1 to DEC Kanji */
  4023.     xl1h7,            /* 2,31 latin-1 to Hebrew-7 */
  4024.     xl1lh,            /* 2,32 latin-1 to Latin/Hebrew */
  4025.     xl162,            /* 2,33 latin-1 to CP862 Hebrew */
  4026.     xl2as,            /* 3,0 latin-2 to us ascii */
  4027.     xl2as,            /* 3,1 latin-2 to uk ascii */
  4028.     xl2as,            /* 3,2 latin-2 to dutch nrc */
  4029.     xl2as,            /* 3,3 latin-2 to finnish nrc */
  4030.     xl2as,            /* 3,4 latin-2 to french nrc */
  4031.     xl2as,            /* 3,5 latin-2 to fr-canadian nrc */
  4032.     xl2as,            /* 3,6 latin-2 to german nrc */
  4033.     xl2as,            /* 3,7 latin-2 to italian nrc */
  4034.     xl2as,            /* 3,8 latin-2 to hungarian nrc */
  4035.     xl2as,            /* 3,9 latin-2 to norge/danish nrc */
  4036.     xl2as,            /* 3,10 latin-2 to portuguese nrc */
  4037.     xl2as,            /* 3,11 latin-2 to spanish nrc */
  4038.     xl2as,            /* 3,12 latin-2 to swedish nrc */
  4039.     xl2as,            /* 3,13 latin-2 to swiss nrc */
  4040.     xl2l1,            /* 3,14 latin-2 to latin-1 */
  4041.     NULL,            /* 3,15 latin-2 to latin-2 */
  4042.     xl2l1,            /* 3,16 latin-2 to DEC MCS */
  4043.     xl2ne,            /* 3,17 latin-2 to NeXT */
  4044.     xl243,            /* 3,18 latin-2 to CP437 */
  4045.     xl285,            /* 3,19 latin-2 to CP850 */
  4046.     xl252,            /* 3,20 latin-2 to CP852 */
  4047.     xl2aq,            /* 3,21 latin-2 to Macintosh Latin */
  4048.     xl2dg,            /* 3,22 latin-2 to DGI */
  4049.     xl2as,            /* 3,23 latin-2 to Latin/Cyrillic */
  4050.     xl2as,                      /* 3,24 latin-2 to CP866 */
  4051.     xl2sk,                      /* 3,25 latin-2 to Short KOI */
  4052.     xl2as,                   /* 3,26 latin-2 to Old KOI-8 Cyrillic */
  4053.     NULL,            /* 3,27 latin-2 to JIS-7 */
  4054.     NULL,            /* 3,28 latin-2 to Shift-JIS */
  4055.     NULL,            /* 3,29 latin-2 to J-EUC */
  4056.     NULL,            /* 3,30 latin-2 to DEC Kanji */
  4057.     xl2h7,            /* 3,31 latin-2 to Hebrew-7 */
  4058.     xl2as,            /* 3,32 latin-2 to Latin/Hebrew */
  4059.     xl2as,            /* 3,33 latin-2 to CP862 Hebrew */
  4060.     xlcas,            /* 4,0 latin/cyrillic to us ascii */
  4061.     xlcas,            /* 4,1 latin/cyrillic to uk ascii */
  4062.     xlcas,                 /* 4,2 latin/cyrillic to dutch nrc */
  4063.     xlcas,            /* 4,3 latin/cyrillic to finnish ascii */
  4064.     xlcas,            /* 4,4 latin/cyrillic to french nrc */
  4065.     xlcas,            /* 4,5 latin/cyrillic to fr-canadian nrc */
  4066.     xlcas,            /* 4,6 latin/cyrillic to german nrc */
  4067.     xlcas,            /* 4,7 latin/cyrillic to italian nrc */
  4068.     xlcas,            /* 4,8 latin/cyrillic to hungarian nrc */
  4069.     xlcas,            /* 4,9 latin/cyrillic to norge/danish nrc */
  4070.     xlcas,            /* 4,10 latin/cyrillic to portuguese nrc */
  4071.     xlcas,            /* 4,11 latin/cyrillic to spanish nrc */
  4072.     xlcas,            /* 4,12 latin/cyrillic to swedish nrc */
  4073.     xlcas,            /* 4,13 latin/cyrillic to swiss nrc */
  4074.     xlcas,            /* 4,14 latin/cyrillic to latin-1 */
  4075.     xlcas,            /* 4,15 latin/cyrillic to latin-2 */
  4076.     xlcas,            /* 4,16 latin/cyrillic to DEC MCS */
  4077.     xlcas,            /* 4,17 latin/cyrillic to NeXT */
  4078.     xlcas,            /* 4,18 latin/cyrillic to CP437 */
  4079.     xlcas,            /* 4,19 latin/cyrillic to CP850 */
  4080.     xlcas,            /* 4,20 latin/cyrillic to CP852 */
  4081.     xlcas,            /* 4,21 latin/cyrillic to Macintosh Latin */
  4082.     xlcas,            /* 4,22 latin/cyrillic to DGI */
  4083.     NULL,                       /* 4,23 latin/cyrillic to Latin/Cyrillic */
  4084.     xlcac,                      /* 4,24 latin/cyrillic to CP866 */
  4085.     xlcsk,                      /* 4,25 latin/cyrillic to Short KOI */
  4086.     xlck8,                   /* 4,26 latin/cyrillic to Old KOI-8 Cyrillic */
  4087.     NULL,            /* 4,27 latin/cyril to JIS-7 */
  4088.     NULL,            /* 4,28 latin/cyril to Shift-JIS */
  4089.     NULL,            /* 4,29 latin/cyril to J-EUC */
  4090.     NULL,            /* 4,30 latin/cyril to DEC Kanji */
  4091.     xlch7,            /* 4,31 latin/cyril to Hebrew-7 */
  4092.     xlcas,            /* 4,32 latin/cyril to Latin/Hebrew */
  4093.     xlcas,            /* 4,33 latin/cyril to CP862 Hebrew */
  4094.  
  4095. /* Kanji to others ... */
  4096.  
  4097.     NULL,            /* 5,00 */
  4098.     NULL,            /* 5,01 */
  4099.     NULL,            /* 5,02 */
  4100.     NULL,            /* 5,03 */
  4101.     NULL,            /* 5,04 */
  4102.     NULL,            /* 5,05 */
  4103.     NULL,            /* 5,06 */
  4104.     NULL,            /* 5,07 */
  4105.     NULL,            /* 5,08 */
  4106.     NULL,            /* 5,09 */
  4107.     NULL,            /* 5,10 */
  4108.     NULL,            /* 5,11 */
  4109.     NULL,            /* 5,12 */
  4110.     NULL,            /* 5,13 */
  4111.     NULL,            /* 5,14 */
  4112.     NULL,            /* 5,15 */
  4113.     NULL,            /* 5,16 */
  4114.     NULL,            /* 5,17 */
  4115.     NULL,            /* 5,18 */
  4116.     NULL,            /* 5,19 */
  4117.     NULL,            /* 5,20 */
  4118.     NULL,            /* 5,21 */
  4119.     NULL,            /* 5,22 */
  4120.     NULL,            /* 5,23 */
  4121.     NULL,            /* 5,24 */
  4122.     NULL,            /* 5,25 */
  4123.     NULL,            /* 5,26 */
  4124.     NULL,            /* 5,27 */
  4125.     NULL,            /* 5,28 */
  4126.     NULL,            /* 5,29 */
  4127.     NULL,            /* 5,30 */
  4128.     NULL,            /* 5,31 */
  4129.     NULL,            /* 5,32 */
  4130.     NULL,            /* 5,33 */
  4131. /* Latin/Hebrew to others */
  4132.     xlhas,            /* 6,0 latin/hebrew to us ascii */
  4133.     xlhas,            /* 6,1 latin/hebrew to uk ascii */
  4134.     xlhas,                 /* 6,2 latin/hebrew to dutch nrc */
  4135.     xlhas,            /* 6,3 latin/hebrew to finnish ascii */
  4136.     xlhas,            /* 6,4 latin/hebrew to french nrc */
  4137.     xlhas,            /* 6,5 latin/hebrew to fr-canadian nrc */
  4138.     xlhas,            /* 6,6 latin/hebrew to german nrc */
  4139.     xlhas,            /* 6,7 latin/hebrew to italian nrc */
  4140.     xlhas,            /* 6,8 latin/hebrew to hungarian nrc */
  4141.     xlhas,            /* 6,9 latin/hebrew to norge/danish nrc */
  4142.     xlhas,            /* 6,10 latin/hebrew to portuguese nrc */
  4143.     xlhas,            /* 6,11 latin/hebrew to spanish nrc */
  4144.     xlhas,            /* 6,12 latin/hebrew to swedish nrc */
  4145.     xlhas,            /* 6,13 latin/hebrew to swiss nrc */
  4146.     xlhl1,            /* 6,14 latin/hebrew to latin-1 */
  4147.     xlhas,            /* 6,15 latin/hebrew to latin-2 */
  4148.     xlhl1,            /* 6,16 latin/hebrew to DEC MCS */
  4149.     xlhas,            /* 6,17 latin/hebrew to NeXT */
  4150.     xlhas,            /* 6,18 latin/hebrew to CP437 */
  4151.     xlhas,            /* 6,19 latin/hebrew to CP850 */
  4152.     xlhas,            /* 6,20 latin/hebrew to CP852 */
  4153.     xlhas,            /* 6,21 latin/hebrew to Macintosh Latin */
  4154.     xlhas,            /* 6,22 latin/hebrew to DGI */
  4155.     xlhas,                      /* 6,23 latin/hebrew to Latin/Cyrillic */
  4156.     xlhas,                      /* 6,24 latin/hebrew to CP866 */
  4157.     NULL,                       /* 6,25 latin/hebrew to Short KOI */
  4158.     xlhas,                   /* 6,26 latin/hebrew to Old KOI-8 Cyrillic */
  4159.     NULL,            /* 6,27 latin/hebrew to JIS-7 */
  4160.     NULL,            /* 6,28 latin/hebrew to Shift-JIS */
  4161.     NULL,            /* 6,29 latin/hebrew to J-EUC */
  4162.     NULL,            /* 6,30 latin/hebrew to DEC Kanji */
  4163.     xlhh7,            /* 6,31 latin/hebrew to Hebrew-7 */
  4164.     NULL,            /* 6,32 latin/hebrew to Latin/Hebrew */
  4165.     xlh62            /* 6,33 latin/hebrew to CP862 Hebrew */
  4166. };
  4167.  
  4168. /*
  4169.   Translation function table for sending files.
  4170.   Array of pointers to functions for translating from the local file
  4171.   character set to the transfer syntax character set.  Indexed in the same
  4172.   way as the xlr array above.
  4173. */
  4174. #ifdef CK_ANSIC
  4175. CHAR (*xls[MAXTCSETS+1][MAXFCSETS+1])(CHAR) =
  4176. #else
  4177. CHAR (*xls[MAXTCSETS+1][MAXFCSETS+1])() =
  4178. #endif /* CK_ANSIC */
  4179. {
  4180.     NULL,            /* 0,0 us ascii to transparent */
  4181.     NULL,            /* 0,1 uk ascii to transparent */
  4182.     NULL,            /* 0,2 dutch nrc to transparent */
  4183.     NULL,            /* 0,3 finnish nrc to transparent */
  4184.     NULL,            /* 0,4 french nrc to transparent */
  4185.     NULL,            /* 0,5 fr-canadian nrc to transparent */
  4186.     NULL,            /* 0,6 german nrc to transparent */
  4187.     NULL,            /* 0,7 hungarian nrc to transparent */
  4188.     NULL,            /* 0,8 italian nrc to transparent */
  4189.     NULL,            /* 0,9 norge/danish nrc to transparent */
  4190.     NULL,            /* 0,10 portuguese nrc to transparent */
  4191.     NULL,            /* 0,11 spanish nrc to transparent */
  4192.     NULL,            /* 0,12 swedish nrc to transparent */
  4193.     NULL,            /* 0,13 swiss nrc to transparent */
  4194.     NULL,            /* 0,14 latin-1 to transparent */
  4195.     NULL,            /* 0,15 latin-2 to transparent */
  4196.     NULL,            /* 0,16 DEC MCS to transparent */
  4197.     NULL,            /* 0,17 NeXT to transparent */
  4198.     NULL,            /* 0,18 CP437 to transparent */
  4199.     NULL,            /* 0,19 CP850 to transparent */
  4200.     NULL,            /* 0,20 CP852 to transparent */
  4201.     NULL,            /* 0,21 Macintosh Latin to transparent */
  4202.     NULL,            /* 0,22 DGI to transparent */
  4203.     NULL,            /* 0,23 Latin/Cyrillic to transparent */
  4204.     NULL,                       /* 0,24 CP866 to transparent */
  4205.     NULL,                       /* 0,25 Short KOI to transparent */
  4206.     NULL,                       /* 0,26 Old KOI-8 to transparent */
  4207.     NULL,            /* 0,27 JIS-7 to transparent */
  4208.     NULL,            /* 0,28 Shift JIS to transparent */
  4209.     NULL,            /* 0,29 Japanese EUC to transparent */
  4210.     NULL,            /* 0,30 DEC Kanji to transparent */
  4211.     NULL,            /* 0,31 Hebrew-7 to transparent */
  4212.     NULL,            /* 0,32 Latin/Hebrew to transparent */
  4213.     NULL,            /* 0,33 CP862 Hebrew to transparent */
  4214.     NULL,            /* 1,0 us ascii to ascii */
  4215.     NULL,            /* 1,1 uk ascii to ascii */
  4216.     xduas,            /* 1,2 dutch nrc to ascii */
  4217.     xfias,            /* 1,3 finnish nrc to ascii */
  4218.     xfras,            /* 1,4 french nrc to ascii */
  4219.     xfcas,            /* 1,5 french canadian nrc to ascii */
  4220.     xgeas,            /* 1,6 german nrc to ascii */
  4221.     xhuas,            /* 1,7 hungarian nrc to ascii */
  4222.     xitas,            /* 1,8 italian nrc to ascii */
  4223.     xnoas,            /* 1,9 norwegian/danish nrc to ascii */
  4224.     xpoas,            /* 1,10 portuguese nrc to ascii */
  4225.     xspas,            /* 1,11 spanish nrc to ascii */
  4226.     xswas,            /* 1,12 swedish nrc to ascii */
  4227.     xchas,            /* 1,13 swiss nrc to ascii */
  4228.     xl1as,            /* 1,14 latin-1 to ascii */
  4229.     xl2as,            /* 1,15 latin-2 to ascii */
  4230.     xdmas,            /* 1,16 dec mcs to ascii */
  4231.     xneas,            /* 1,17 NeXT to ascii */
  4232.     x43as,            /* 1,18 CP437 to ascii */
  4233.     x85as,            /* 1,19 CP850 to ascii */
  4234.     x52as,            /* 1,20 CP850 to ascii */
  4235.     xaqas,            /* 1,21 Macintosh Latin to ascii */
  4236.     xdgas,            /* 1,22 DGI to ascii */
  4237.     xlcas,            /* 1,23 Latin/Cyrillic to ASCII */
  4238.     xacas,                      /* 1,24 CP866 to ASCII */
  4239.     xskas,            /* 1,25 Short KOI to ASCII */
  4240.     xk8as,                      /* 1,26 Old KOI-8 Cyrillic to ASCII */
  4241.     NULL,            /* 1,27 */
  4242.     NULL,            /* 1,28 */
  4243.     NULL,            /* 1,29 */
  4244.     NULL,            /* 1,30 */
  4245.     xh7as,            /* 1,31 Hebrew-7 to ASCII */
  4246.     xlhas,            /* 1,32 Latin/Hebrew to ASCII */
  4247.     x62as,            /* 1,33 CP862 Hebrew to ASCII */
  4248.     NULL,            /* 2,0 us ascii to latin-1 */
  4249.     xukl1,            /* 2,1 uk ascii to latin-1 */
  4250.     xdul1,            /* 2,2 dutch nrc to latin-1 */
  4251.     xfil1,            /* 2,3 finnish nrc to latin-1 */
  4252.     xfrl1,            /* 2,4 french nrc to latin-1 */
  4253.     xfcl1,            /* 2,5 french canadian nrc to latin-1 */
  4254.     xgel1,            /* 2,6 german nrc to latin-1 */
  4255.     xhul1,            /* 2,7 hungarian nrc to latin-1 */
  4256.     xitl1,            /* 2,8 italian nrc to latin-1 */
  4257.     xnol1,            /* 2,9 norwegian/danish nrc to latin-1 */
  4258.     xpol1,            /* 2,10 portuguese nrc to latin-1 */
  4259.     xspl1,            /* 2,11 spanish nrc to latin-1 */
  4260.     xswl1,            /* 2,12 swedish nrc to latin-1 */
  4261.     xchl1,            /* 2,13 swiss nrc to latin-1 */
  4262.     NULL,            /* 2,14 latin-1 to latin-1 */
  4263.     xl2l1,            /* 2,15 latin-2 to latin-1 */
  4264.     xdml1,            /* 2,16 dec mcs to latin-1 */
  4265.     xnel1,                      /* 2,17 NeXT to Latin-1 */
  4266.     x43l1,                      /* 2,18 CP437 to Latin-1 */
  4267.     x85l1,                      /* 2,19 CP850 to Latin-1 */
  4268.     x52l1,                      /* 2,20 CP852 to Latin-1 */
  4269.     xaql1,                      /* 2,21 Macintosh Latin to Latin-1 */
  4270.     xdgl1,                      /* 2,22 DGI to Latin-1 */
  4271.     xlcas,                      /* 2,23 Latin/Cyrillic to Latin-1 */
  4272.     xacas,                      /* 2,24 CP866 to Latin-1 */
  4273.     xskas,                      /* 2,25 Short KOI to Latin-1 */
  4274.     xk8as,                      /* 2,26 Old KOI-8 Cyrillic to Latin-1 */
  4275.     NULL,            /* 2,27 Kanji ... */
  4276.     NULL,            /* 2,28 */
  4277.     NULL,            /* 2,29 */
  4278.     NULL,            /* 2,30 */
  4279.     xh7as,            /* 2,31 Hebrew-7 to Latin-1 */
  4280.     xlhl1,            /* 2,32 Latin/Hebrew to Latin-1 */
  4281.     x62l1,            /* 2,33 CP862 Hebrew to Latin-1 */
  4282.     NULL,            /* 3,0 us ascii to latin-2 */
  4283.     NULL,            /* 3,1 uk ascii to latin-2 */
  4284.     xduas,            /* 3,2 dutch nrc to latin-2 */
  4285.     xfias,            /* 3,3 finnish nrc to latin-2 */
  4286.     xfras,            /* 3,4 french nrc to latin-2 */
  4287.     xfcas,            /* 3,5 french canadian nrc to latin-2 */
  4288.     xgel2,            /* 3,6 german nrc to latin-2 */
  4289.     xhul2,            /* 3,7 hungarian nrc to latin-2 */
  4290.     xitas,            /* 3,8 italian nrc to latin-2 */
  4291.     xnoas,            /* 3,9 norwegian/danish nrc to latin-2 */
  4292.     xpoas,            /* 3,10 portuguese nrc to latin-2 */
  4293.     xspas,            /* 3,11 spanish nrc to latin-2 */
  4294.     xswas,            /* 3,12 swedish nrc to latin-2 */
  4295.     xchas,            /* 3,13 swiss nrc to latin-2 */
  4296.     xl1l2,            /* 3,14 latin-1 to latin-2 */
  4297.     NULL,            /* 3,15 latin-2 to latin-2 */
  4298.     xl1l2,            /* 3,16 dec mcs to latin-2 */
  4299.     xnel2,                      /* 3,17 NeXT to Latin-2 */
  4300.     x43l2,                      /* 3,18 CP437 to Latin-2 */
  4301.     x85l2,                      /* 3,19 CP850 to Latin-2 */
  4302.     x52l2,                      /* 3,20 CP852 to Latin-2 */
  4303.     xaql2,                      /* 3,21 Macintosh Latin to Latin-2 */
  4304.     xdgl2,                      /* 3,22 DGI to Latin-2 */
  4305.     xlcas,                      /* 3,23 Latin/Cyrillic to Latin-2 */
  4306.     xacas,                      /* 3,24 CP866 to Latin-2 */
  4307.     xskas,                      /* 3,25 Short KOI to Latin-2 */
  4308.     xk8as,                      /* 3,26 Old KOI-8 Cyrillic to Latin-2 */
  4309.     NULL,            /* 3,27 Kanji ... */
  4310.     NULL,            /* 3,28 */
  4311.     NULL,            /* 3,29 */
  4312.     NULL,            /* 3,30 */
  4313.     xh7as,            /* 3,31 Hebrew-7 to Latin-2 */
  4314.     xlhas,            /* 3,32 Latin/Hebrew to Latin-2 */
  4315.     x62as,            /* 3,33 CP862 Hebrew to Latin-2 */
  4316.     xaslc,            /* 4,0 us ascii to latin/cyrillic */
  4317.     xaslc,            /* 4,1 uk ascii to latin/cyrillic */
  4318.     xduas,            /* 4,2 dutch nrc to latin/cyrillic */
  4319.     xfias,            /* 4,3 finnish nrc to latin/cyrillic */
  4320.     xfras,            /* 4,4 french nrc to latin/cyrillic */
  4321.     xfcas,            /* 4,5 french canadian nrc to latin/cyrillic */
  4322.     xgeas,            /* 4,6 german nrc to latin/cyrillic */
  4323.     xhuas,            /* 4,7 hungarian nrc to latin/cyrillic */
  4324.     xitas,            /* 4,8 italian nrc to latin/cyrillic */
  4325.     xnoas,            /* 4,9 norge/danish nrc to latin/cyrillic */
  4326.     xpoas,            /* 4,10 portuguese nrc to latin/cyrillic */
  4327.     xspas,            /* 4,11 spanish nrc to latin/cyrillic */
  4328.     xswas,            /* 4,12 swedish nrc to latin/cyrillic */
  4329.     xchas,            /* 4,13 swiss nrc to latin/cyrillic */
  4330.     xl1as,            /* 4,14 latin-1 to latin/cyrillic */
  4331.     xl2as,            /* 4,15 latin-2 to latin/cyrillic */
  4332.     xdmas,            /* 4,16 dec mcs to latin/cyrillic */
  4333.     xneas,            /* 4,17 NeXT to latin/cyrillic */
  4334.     x43as,            /* 4,18 CP437 to latin/cyrillic */
  4335.     x85as,            /* 4,19 CP850 to latin/cyrillic */
  4336.     x52as,            /* 4,20 CP852 to latin/cyrillic */
  4337.     xaqas,            /* 4,21 Macintosh Latin to latin/cyrillic */
  4338.     xdgas,            /* 4,22 DGI to Latin/Cyrillic */
  4339.     NULL,                       /* 4,23 Latin/Cyrillic to Latin/Cyrillic */
  4340.     xaclc,                      /* 4,24 CP866 to Latin/Cyrillic */
  4341.     xskcy,                      /* 4,25 Short KOI to Latin/Cyrillic */
  4342.     xk8lc,                      /* 4,26 Old KOI-8 Cyrillic to Latin/Cyrillic */
  4343.     NULL,            /* 4,27 Kanji... */
  4344.     NULL,            /* 4,28 */
  4345.     NULL,            /* 4,29 */
  4346.     NULL,            /* 4,30 */
  4347.     xh7as,            /* 4,31 Hebrew-7 to Latin/Cyrillic */
  4348.     xlhas,            /* 4,32 Latin/Hebrew to Latin/Cyrillic */
  4349.     x62as,            /* 4,33 CP862 Hebrew to Latin/Cyrillic */
  4350.     NULL,            /* 5,00 */
  4351.     NULL,            /* 5,01 */
  4352.     NULL,            /* 5,02 */
  4353.     NULL,            /* 5,03 */
  4354.     NULL,            /* 5,04 */
  4355.     NULL,            /* 5,05 */
  4356.     NULL,            /* 5,06 */
  4357.     NULL,            /* 4.07 */
  4358.     NULL,            /* 5,08 */
  4359.     NULL,            /* 5,09 */
  4360.     NULL,            /* 5,10 */
  4361.     NULL,            /* 5,11 */
  4362.     NULL,            /* 5,12 */
  4363.     NULL,            /* 5,13 */
  4364.     NULL,            /* 5,14 */
  4365.     NULL,            /* 5,15 */
  4366.     NULL,            /* 5,16 */
  4367.     NULL,            /* 5,17 */
  4368.     NULL,            /* 5,18 */
  4369.     NULL,            /* 5,19 */
  4370.     NULL,            /* 5,20 */
  4371.     NULL,            /* 5,21 */
  4372.     NULL,            /* 5,22 */
  4373.     NULL,            /* 5,23 */
  4374.     NULL,            /* 5,24 */
  4375.     NULL,            /* 5,25 */
  4376.     NULL,            /* 5,26 */
  4377.     NULL,            /* 5,27 */
  4378.     NULL,            /* 5,28 */
  4379.     NULL,            /* 5,29 */
  4380.     NULL,            /* 5,30 */
  4381.     NULL,            /* 5,31 */
  4382.     NULL,            /* 5,32 */
  4383.     NULL,            /* 5,33 */
  4384.     NULL,            /* 6,0 us ascii to latin/hebrew */
  4385.     NULL,            /* 6,1 uk ascii to latin/hebrew */
  4386.     xduas,            /* 6,2 dutch nrc to latin/hebrew */
  4387.     xfias,            /* 6,3 finnish nrc to latin/hebrew */
  4388.     xfras,            /* 6,4 french nrc to latin/hebrew */
  4389.     xfcas,            /* 6,5 french canadian nrc to latin/hebrew */
  4390.     xgeas,            /* 6,6 german nrc to latin/hebrew */
  4391.     xhuas,            /* 6,7 hungarian nrc to latin/hebrew */
  4392.     xitas,            /* 6,8 italian nrc to latin/hebrew */
  4393.     xnoas,            /* 6,9 norge/danish nrc to latin/hebrew */
  4394.     xpoas,            /* 6,10 portuguese nrc to latin/hebrew */
  4395.     xspas,            /* 6,11 spanish nrc to latin/hebrew */
  4396.     xswas,            /* 6,12 swedish nrc to latin/hebrew */
  4397.     xchas,            /* 6,13 swiss nrc to latin/hebrew */
  4398.     xl1lh,            /* 6,14 latin-1 to latin/hebrew */
  4399.     xl2as,            /* 6,15 latin-2 to latin/hebrew */
  4400.     xdmas,            /* 6,16 dec mcs to latin/hebrew */
  4401.     xneas,            /* 6,17 NeXT to latin/hebrew */
  4402.     x43as,            /* 6,18 CP437 to latin/hebrew */
  4403.     x85as,            /* 6,19 CP850 to latin/hebrew */
  4404.     x52as,            /* 6,20 CP852 to latin/hebrew */
  4405.     xaqas,            /* 6,21 Macintosh Latin to latin/hebrew */
  4406.     xdgas,            /* 6,22 DGI to Latin/hebrew */
  4407.     xlcas,                      /* 6,23 Latin/Cyrillic to latin/hebrew */
  4408.     xacas,                      /* 6,24 CP866 to Latin/hebrew */
  4409.     xskas,                      /* 6,25 Short KOI to Latin/hebrew */
  4410.     xk8as,                      /* 6,26 Old KOI-8 Cyrillic to Latin/hebrew */
  4411.     NULL,            /* 6,27 Kanji... */
  4412.     NULL,            /* 4,28 */
  4413.     NULL,            /* 4,29 */
  4414.     NULL,            /* 4,30 */
  4415.     xh7lh,            /* 4,31 Hebrew-7 to Latin/hebrew */
  4416.     NULL,            /* 6,32 Latin/Hebrew to Latin/hebrew */
  4417.     x62lh            /* 6,33 CP862 Hebrew to Latin/hebrew */
  4418. };
  4419. #endif /* NOCSETS */
  4420.